transaction: strip off a layer of redirection from ClaimTX.Claims

We don't need a pointer here and this change makes this field compatible with
Transaction.Inputs which is useful in many scenarios.
This commit is contained in:
Roman Khimov 2020-02-24 18:22:27 +03:00
parent d5e6028c13
commit 5c9681508b
2 changed files with 3 additions and 3 deletions

View file

@ -1331,8 +1331,8 @@ func (bc *Blockchain) GetScriptHashesForVerifyingClaim(t *transaction.Transactio
claim := t.Data.(*transaction.ClaimTX)
clGroups := make(map[util.Uint256][]*transaction.Input)
for _, in := range claim.Claims {
clGroups[in.PrevHash] = append(clGroups[in.PrevHash], in)
for i := range claim.Claims {
clGroups[claim.Claims[i].PrevHash] = append(clGroups[claim.Claims[i].PrevHash], &claim.Claims[i])
}
for group, inputs := range clGroups {
refTx, _, err := bc.dao.GetTransaction(group)

View file

@ -6,7 +6,7 @@ import (
// ClaimTX represents a claim transaction.
type ClaimTX struct {
Claims []*Input
Claims []Input
}
// DecodeBinary implements Serializable interface.