diff --git a/blockchain/chain.go b/blockchain/chain.go index 8a4506c3e6..8d7e4ff42e 100644 --- a/blockchain/chain.go +++ b/blockchain/chain.go @@ -884,6 +884,16 @@ func (b *BlockChain) connectBlock(node *blockNode, block, parent *dcrutil.Block, b.stateSnapshot = state b.stateLock.Unlock() + // Assemble the current block and the parent into a slice. + blockAndParent := []*dcrutil.Block{block, parent} + + // Notify the caller that the block was connected to the main chain. + // The caller would typically want to react with actions such as + // updating wallets. + b.chainLock.Unlock() + b.sendNotification(NTBlockConnected, blockAndParent) + b.chainLock.Lock() + // Send stake notifications about the new block. if node.height >= b.chainParams.StakeEnabledHeight { nextStakeDiff, err := b.calcNextRequiredStakeDifficulty(node) @@ -913,16 +923,6 @@ func (b *BlockChain) connectBlock(node *blockNode, block, parent *dcrutil.Block, }) } - // Assemble the current block and the parent into a slice. - blockAndParent := []*dcrutil.Block{block, parent} - - // Notify the caller that the block was connected to the main chain. - // The caller would typically want to react with actions such as - // updating wallets. - b.chainLock.Unlock() - b.sendNotification(NTBlockConnected, blockAndParent) - b.chainLock.Lock() - // Optimization: Before checkpoints, immediately dump the parent's stake // node because we no longer need it. if node.height < b.chainParams.LatestCheckpointHeight() { diff --git a/rpcserver.go b/rpcserver.go index f66131068a..d72b95a53e 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -53,10 +53,10 @@ import ( // API version constants const ( - jsonrpcSemverString = "4.0.0" + jsonrpcSemverString = "4.0.1" jsonrpcSemverMajor = 4 jsonrpcSemverMinor = 0 - jsonrpcSemverPatch = 0 + jsonrpcSemverPatch = 1 ) const (