diff options
author | Determinant <[email protected]> | 2020-09-17 01:36:24 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2020-09-17 01:36:24 -0400 |
commit | 160a8f543b3a2e9ed38f806015e4f1f0d1f49f8d (patch) | |
tree | 7485983a38870ad415d0100e830311eafe87ff3c /core/blockchain.go | |
parent | 7063564c571bcdc94b981db7ed3707902f0466d0 (diff) |
revert the SetTail logic
Diffstat (limited to 'core/blockchain.go')
-rw-r--r-- | core/blockchain.go | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/core/blockchain.go b/core/blockchain.go index b3a7ffa..82e3b6c 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -2492,13 +2492,12 @@ func (bc *BlockChain) SubscribeBlockProcessingEvent(ch chan<- bool) event.Subscr } func (bc *BlockChain) ManualHead(hash common.Hash) error { - return bc.FastSyncCommitHead(hash) - //block := bc.GetBlockByHash(hash) - //if block == nil { - // return errors.New("block not found") - //} - //bc.chainmu.Lock() - //defer bc.chainmu.Unlock() - //bc.writeHeadBlock(block) - //return nil + block := bc.GetBlockByHash(hash) + if block == nil { + return errors.New("block not found") + } + bc.chainmu.Lock() + defer bc.chainmu.Unlock() + bc.writeHeadBlock(block) + return nil } |