mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-25 03:56:34 +00:00
Merge pull request #489 from nspcc-dev/claim-processing
core: add proper claim transactions processing
This commit is contained in:
commit
5f8edc3e54
1 changed files with 15 additions and 0 deletions
|
@ -431,6 +431,21 @@ func (bc *Blockchain) storeBlock(block *Block) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case *transaction.ClaimTX:
|
case *transaction.ClaimTX:
|
||||||
|
// Remove claimed NEO from spent coins making it unavalaible for
|
||||||
|
// additional claims.
|
||||||
|
for _, input := range t.Claims {
|
||||||
|
scs, err := spentCoins.getAndUpdate(bc.store, input.PrevHash)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if scs.txHash == input.PrevHash {
|
||||||
|
// Existing scs.
|
||||||
|
delete(scs.items, input.PrevIndex)
|
||||||
|
} else {
|
||||||
|
// Uninitialized, new, forget about it.
|
||||||
|
delete(spentCoins, input.PrevHash)
|
||||||
|
}
|
||||||
|
}
|
||||||
case *transaction.EnrollmentTX:
|
case *transaction.EnrollmentTX:
|
||||||
case *transaction.StateTX:
|
case *transaction.StateTX:
|
||||||
case *transaction.PublishTX:
|
case *transaction.PublishTX:
|
||||||
|
|
Loading…
Reference in a new issue