From 10601cb3756ff1f22ed5c4f06d10a70fac20716b Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 12 Mar 2020 18:06:26 +0300 Subject: [PATCH] core: add issuer hashes into the verification list for Issue TX As it should be done. --- pkg/core/blockchain.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index f4a4f4ab5..85a439d67 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -1942,6 +1942,16 @@ func (bc *Blockchain) GetScriptHashesForVerifying(t *transaction.Transaction) ([ case transaction.EnrollmentType: etx := t.Data.(*transaction.EnrollmentTX) 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: reg := t.Data.(*transaction.RegisterTX) hashes[reg.Owner.GetScriptHash()] = true