mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-12 11:10:35 +00:00
core: drop NEP5 tracker data if balance is zero
Makes no sense storing it and returning to the user (C# plugin doesn't do that).
This commit is contained in:
parent
d4f26fe473
commit
38842531ca
1 changed files with 6 additions and 2 deletions
|
@ -945,8 +945,12 @@ func (bc *Blockchain) processNEP5Transfer(cache *dao.Cached, transfer *state.NEP
|
|||
}
|
||||
bs := balances.Trackers[transfer.Asset]
|
||||
bs.Balance -= transfer.Amount
|
||||
if bs.Balance != 0 {
|
||||
bs.LastUpdatedBlock = transfer.Block
|
||||
balances.Trackers[transfer.Asset] = bs
|
||||
} else {
|
||||
delete(balances.Trackers, transfer.Asset)
|
||||
}
|
||||
|
||||
transfer.Amount = -transfer.Amount
|
||||
isBig, err := cache.AppendNEP5Transfer(transfer.From, balances.NextTransferBatch, transfer)
|
||||
|
|
Loading…
Reference in a new issue