From eb1749d190a599004906e80a4d2f8fd6fa01b115 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 12 Dec 2019 21:14:33 +0300 Subject: [PATCH] core: remove persisting from GetValidators() It's a getter function and even though it's quite fancy with its transactions processing (for consensus operation) it shouldn't ever change the state of the Blockchain. If we're to change anything here these changes may conflict with the actual block processing later or may lead to broken state (if transactions won't be approved for some reason). --- pkg/core/blockchain.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index f574a3631..3ce0b486e 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -1249,10 +1249,6 @@ func (bc *Blockchain) GetValidators(txes ...*transaction.Transaction) ([]*keys.P for i := 0; i < uniqueSBValidators.Len() && result.Len() < count; i++ { result = append(result, uniqueSBValidators[i]) } - _, err = cache.store.Persist() - if err != nil { - return nil, err - } return result, nil }