diff --git a/blockmanager.go b/blockmanager.go index 29ac5215..85fd1ae1 100644 --- a/blockmanager.go +++ b/blockmanager.go @@ -946,7 +946,6 @@ func (b *blockManager) checkBlockForHiddenVotes(block *dcrutil.Block) { // the parent template hasn't yet been updated, so we may // need to use the current template. var template *BlockTemplate - if b.cachedCurrentTemplate != nil { if b.cachedCurrentTemplate.height == block.Height() { @@ -961,6 +960,11 @@ func (b *blockManager) checkBlockForHiddenVotes(block *dcrutil.Block) { } } + // No template to alter. + if template == nil { + return + } + // Make sure that the template has the same parent // as the new block. if template.block.Header.PrevBlock != @@ -1011,9 +1015,6 @@ func (b *blockManager) checkBlockForHiddenVotes(block *dcrutil.Block) { newVotes = append(newVotes, vote) } } - } else { - // We have no template, so nothing to update. - return } // Check the length of the reconstructed voter list for