Skip to content

Commit d4d64f6

Browse files
committed
fix: don't remove handlers too early
1 parent a26a974 commit d4d64f6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/init.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@ void PrepareShutdown(NodeContext& node)
289289
StopREST();
290290
StopRPC();
291291
StopHTTPServer();
292-
if (node.peerman) node.peerman->RemoveHandlers();
293292

294293
if (node.active_ctx) node.active_ctx->Stop();
295294
if (node.peerman) node.peerman->StopHandlers();

src/net_processing.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,11 @@ class PeerManagerImpl final : public PeerManager
595595
const std::unique_ptr<ActiveContext>& active_ctx, CJWalletManager* const cj_walletman,
596596
const std::unique_ptr<LLMQContext>& llmq_ctx, bool ignore_incoming_txs);
597597

598+
~PeerManagerImpl()
599+
{
600+
RemoveHandlers();
601+
}
602+
598603
/** Overridden from CValidationInterface. */
599604
void BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindexConnected) override
600605
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex, !m_recent_confirmed_transactions_mutex);

0 commit comments

Comments
 (0)