mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-27 03:58:06 +00:00
core: add issuer hashes into the verification list for Issue TX
As it should be done.
This commit is contained in:
parent
a9e5cdd6cc
commit
10601cb375
1 changed files with 10 additions and 0 deletions
|
@ -1942,6 +1942,16 @@ func (bc *Blockchain) GetScriptHashesForVerifying(t *transaction.Transaction) ([
|
||||||
case transaction.EnrollmentType:
|
case transaction.EnrollmentType:
|
||||||
etx := t.Data.(*transaction.EnrollmentTX)
|
etx := t.Data.(*transaction.EnrollmentTX)
|
||||||
hashes[etx.PublicKey.GetScriptHash()] = true
|
hashes[etx.PublicKey.GetScriptHash()] = true
|
||||||
|
case transaction.IssueType:
|
||||||
|
for _, res := range refsAndOutsToResults(references, t.Outputs) {
|
||||||
|
if res.Amount < 0 {
|
||||||
|
asset, err := bc.dao.GetAssetState(res.AssetID)
|
||||||
|
if asset == nil || err != nil {
|
||||||
|
return nil, errors.New("invalid asset in issue tx")
|
||||||
|
}
|
||||||
|
hashes[asset.Issuer] = true
|
||||||
|
}
|
||||||
|
}
|
||||||
case transaction.RegisterType:
|
case transaction.RegisterType:
|
||||||
reg := t.Data.(*transaction.RegisterTX)
|
reg := t.Data.(*transaction.RegisterTX)
|
||||||
hashes[reg.Owner.GetScriptHash()] = true
|
hashes[reg.Owner.GetScriptHash()] = true
|
||||||
|
|
Loading…
Reference in a new issue