diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index 3ce0b486e..e92016dc6 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -505,7 +505,7 @@ func (bc *Blockchain) storeBlock(block *Block) error { v.LoadScript(t.Script) err := v.Run() if !v.HasFailed() { - _, err := systemInterop.dao.store.Persist() + _, err := systemInterop.dao.Persist() if err != nil { return errors.Wrap(err, "failed to persist invocation results") } @@ -554,7 +554,7 @@ func (bc *Blockchain) storeBlock(block *Block) error { } } } - _, err := cache.store.Persist() + _, err := cache.Persist() if err != nil { return err } @@ -690,7 +690,7 @@ func (bc *Blockchain) persist() error { err error ) - persisted, err = bc.dao.store.Persist() + persisted, err = bc.dao.Persist() if err != nil { return err } diff --git a/pkg/core/dao.go b/pkg/core/dao.go index c6bbd2ddc..846847b7d 100644 --- a/pkg/core/dao.go +++ b/pkg/core/dao.go @@ -555,3 +555,9 @@ func (dao *dao) IsDoubleSpend(tx *transaction.Transaction) bool { } return false } + +// Persist flushes all the changes made into the (supposedly) persistent +// underlying store. +func (dao *dao) Persist() (int, error) { + return dao.store.Persist() +}