From 2382d05fb23bc596097f0c5f0eb57b3fd30d7d45 Mon Sep 17 00:00:00 2001 From: Andrew Davis <1709934+Savid@users.noreply.github.com> Date: Mon, 22 Dec 2025 10:43:16 +1000 Subject: [PATCH] core: track newPayloadFeed subscriptions in scope Wrap SubscribeNewPayloadEvent with bc.scope.Track() to ensure subscriptions are properly cleaned up on shutdown, consistent with other BlockChain subscription methods. Also fix typo in the method's doc comment. --- core/blockchain_reader.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/blockchain_reader.go b/core/blockchain_reader.go index e93ff5c33c..ee15c152c4 100644 --- a/core/blockchain_reader.go +++ b/core/blockchain_reader.go @@ -523,9 +523,9 @@ func (bc *BlockChain) SubscribeBlockProcessingEvent(ch chan<- bool) event.Subscr return bc.scope.Track(bc.blockProcFeed.Subscribe(ch)) } -// / SubscribeNewPayloadEvent registers a subscription for NewPayloadEvent. +// SubscribeNewPayloadEvent registers a subscription for NewPayloadEvent. func (bc *BlockChain) SubscribeNewPayloadEvent(ch chan<- NewPayloadEvent) event.Subscription { - return bc.newPayloadFeed.Subscribe(ch) + return bc.scope.Track(bc.newPayloadFeed.Subscribe(ch)) } // SendNewPayloadEvent sends a NewPayloadEvent to subscribers.