mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 01:41:36 +00:00
trie/bintrie: truncate balanceBytes with last 16 bytes
This commit is contained in:
parent
8e2107dc39
commit
524aef69db
1 changed files with 1 additions and 1 deletions
|
|
@ -239,7 +239,7 @@ func (t *BinaryTrie) UpdateAccount(addr common.Address, acc *types.StateAccount,
|
||||||
// TODO: reduce the size of the allocation in devmode, then panic instead
|
// TODO: reduce the size of the allocation in devmode, then panic instead
|
||||||
// of truncating.
|
// of truncating.
|
||||||
if len(balanceBytes) > 16 {
|
if len(balanceBytes) > 16 {
|
||||||
balanceBytes = balanceBytes[16:]
|
balanceBytes = balanceBytes[len(balanceBytes)-16:]
|
||||||
}
|
}
|
||||||
copy(basicData[HashSize-len(balanceBytes):], balanceBytes[:])
|
copy(basicData[HashSize-len(balanceBytes):], balanceBytes[:])
|
||||||
values[BasicDataLeafKey] = basicData[:]
|
values[BasicDataLeafKey] = basicData[:]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue