stateroot: fix missing verification script

Stateroot payload must have it.
This commit is contained in:
Roman Khimov 2021-03-26 13:44:02 +03:00
parent 5f7ec6e784
commit 5569512ce9

View file

@ -77,12 +77,17 @@ func (r *incompleteRoot) finalize(stateValidators keys.PublicKeys) (*state.MPTRo
return nil, false
}
verif, err := smartcontract.CreateDefaultMultiSigRedeemScript(stateValidators)
if err != nil {
return nil, false
}
w := io.NewBufBinWriter()
for i := range sigs {
emit.Bytes(w.BinWriter, sigs[i])
}
r.root.Witness = []transaction.Witness{{
InvocationScript: w.Bytes(),
VerificationScript: verif,
}}
return r.root, true
}