mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-04 19:19:44 +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 := balances.Trackers[transfer.Asset]
|
||||||
bs.Balance -= transfer.Amount
|
bs.Balance -= transfer.Amount
|
||||||
bs.LastUpdatedBlock = transfer.Block
|
if bs.Balance != 0 {
|
||||||
balances.Trackers[transfer.Asset] = bs
|
bs.LastUpdatedBlock = transfer.Block
|
||||||
|
balances.Trackers[transfer.Asset] = bs
|
||||||
|
} else {
|
||||||
|
delete(balances.Trackers, transfer.Asset)
|
||||||
|
}
|
||||||
|
|
||||||
transfer.Amount = -transfer.Amount
|
transfer.Amount = -transfer.Amount
|
||||||
isBig, err := cache.AppendNEP5Transfer(transfer.From, balances.NextTransferBatch, transfer)
|
isBig, err := cache.AppendNEP5Transfer(transfer.From, balances.NextTransferBatch, transfer)
|
||||||
|
|
Loading…
Reference in a new issue