From 5a23b058525a51bc22f730d5d897fb202b702009 Mon Sep 17 00:00:00 2001 From: cjepson Date: Wed, 5 Oct 2016 17:18:21 -0400 Subject: [PATCH] Fix a bug reloading the blockchain A bug in the restoration of stake nodes from the disk would prevent the blockchain from reloading if there was an immediate reorganization required on start up. This correctly disconnects the block. --- blockchain/stakenode.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blockchain/stakenode.go b/blockchain/stakenode.go index e68a053a..5bccb5ae 100644 --- a/blockchain/stakenode.go +++ b/blockchain/stakenode.go @@ -167,8 +167,8 @@ func (b *BlockChain) fetchStakeNode(node *blockNode) (*stake.Node, error) { var errLocal error if current.parent.stakeNode == nil { current.parent.stakeNode, errLocal = - current.stakeNode.DisconnectNode(current.header, - current.stakeUndoData, current.newTickets, dbTx) + current.stakeNode.DisconnectNode(current.parent.header, + current.parent.stakeUndoData, current.parent.newTickets, dbTx) } if errLocal != nil { return errLocal