Skip to content

Commit 743227f

Browse files
committed
dbft: use uint256.Int for withdrawals counting
Follow the notion of ethereum/go-ethereum#28598. Signed-off-by: Anna Shaleva <[email protected]>
1 parent cb6adb8 commit 743227f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

consensus/dbft/dbft.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ import (
5252
"github.com/ethereum/go-ethereum/rlp"
5353
"github.com/ethereum/go-ethereum/rpc"
5454
"github.com/ethereum/go-ethereum/trie"
55+
"github.com/holiman/uint256"
5556
"github.com/nspcc-dev/dbft"
5657
"github.com/nspcc-dev/dbft/block"
5758
dbftCrypto "github.com/nspcc-dev/dbft/crypto"
@@ -943,8 +944,8 @@ func (c *DBFT) Finalize(chain consensus.ChainHeaderReader, header *types.Header,
943944
// Withdrawals processing.
944945
for _, w := range withdrawals {
945946
// Convert amount from gwei to wei.
946-
amount := new(big.Int).SetUint64(w.Amount)
947-
amount = amount.Mul(amount, big.NewInt(params.GWei))
947+
amount := new(uint256.Int).SetUint64(w.Amount)
948+
amount = amount.Mul(amount, uint256.NewInt(params.GWei))
948949
state.AddBalance(w.Address, amount)
949950
}
950951
// No block rewards in PoA, so the state remains as is

0 commit comments

Comments
 (0)