From 38f0432f36084f1657a59b132dc14415ce98a7cf Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 16 Jul 2020 23:06:17 +0300 Subject: [PATCH] core: remove stale storeBlock comment, fix #365 After transaction unification and UTXO removal storeBlock became quite simple and doesn't require any refactoring any more. --- pkg/core/blockchain.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index f25a0673a..943f31a84 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -550,10 +550,9 @@ func (bc *Blockchain) processHeader(h *block.Header, batch storage.Batch, header return nil } -// TODO: storeBlock needs some more love, its implemented as in the original -// project. This for the sake of development speed and understanding of what -// is happening here, quite allot as you can see :). If things are wired together -// and all tests are in place, we can make a more optimized and cleaner implementation. +// storeBlock performs chain update using the block given, it executes all +// transactions with all appropriate side-effects and updates Blockchain state. +// This is the only way to change Blockchain state. func (bc *Blockchain) storeBlock(block *block.Block) error { cache := dao.NewCached(bc.dao) appExecResults := make([]*state.AppExecResult, 0, 1+len(block.Transactions))