From 9c039f5fe437671f68afb32a4397f5ad8e9ed4c7 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Fri, 21 Aug 2015 16:30:34 +0200 Subject: [PATCH] Fix longpoll getblocktemplate not getting notified if a block is pushed via submitblock --- blockmanager.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/blockmanager.go b/blockmanager.go index 68d0161027..c907e6e1ba 100644 --- a/blockmanager.go +++ b/blockmanager.go @@ -1142,6 +1142,14 @@ out: newestSha, newestHeight, _ := b.server.db.NewestSha() b.updateChainState(newestSha, newestHeight) + // Allow any clients performing long polling via the + // getblocktemplate RPC to be notified when the new block causes + // their old block template to become stale. + rpcServer := b.server.rpcServer + if rpcServer != nil { + rpcServer.gbtWorkState.NotifyBlockConnected(msg.block.Sha()) + } + msg.reply <- processBlockResponse{ isOrphan: isOrphan, err: nil,