aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2020-09-17 01:36:24 -0400
committerDeterminant <[email protected]>2020-09-17 01:36:24 -0400
commit160a8f543b3a2e9ed38f806015e4f1f0d1f49f8d (patch)
tree7485983a38870ad415d0100e830311eafe87ff3c /core
parent7063564c571bcdc94b981db7ed3707902f0466d0 (diff)
revert the SetTail logic
Diffstat (limited to 'core')
-rw-r--r--core/blockchain.go17
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
}