Skip to content

Commit 1657584

Browse files
committed
accounts: fix compilation issue for i386 systems
Apparently the %d formatting directive implicitly uses `int` as its data type, which on i386 systems is int32. So the value math.MaxInt64 overflows that value, which causes the compilation to fail.
1 parent 4a3a628 commit 1657584

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

accounts/store_kvdb.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ func (s *BoltStore) IncreaseAccountBalance(_ context.Context, id AccountID,
244244

245245
update := func(account *OffChainBalanceAccount) error {
246246
if amount > math.MaxInt64 {
247-
return fmt.Errorf("amount %d exceeds the maximum of %d",
248-
amount, math.MaxInt64)
247+
return fmt.Errorf("amount %v exceeds the maximum of %v",
248+
amount, int64(math.MaxInt64))
249249
}
250250

251251
account.CurrentBalance += int64(amount)

0 commit comments

Comments
 (0)