core: use GetAccountStateOrNew() in (*Blockchain).GetValidators()

Target of the transaction output may not yet exist in database.
This commit is contained in:
Evgenii Stratonikov 2020-02-28 11:08:46 +03:00
parent ed190dcfd3
commit de5215a564

View file

@ -1580,7 +1580,7 @@ func (bc *Blockchain) GetValidators(txes ...*transaction.Transaction) ([]*keys.P
for _, tx := range txes {
// iterate through outputs
for index, output := range tx.Outputs {
accountState, err := cache.GetAccountState(output.ScriptHash)
accountState, err := cache.GetAccountStateOrNew(output.ScriptHash)
if err != nil {
return nil, err
}