mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 20:56:42 +00:00
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.
This commit is contained in:
parent
63c4383bd2
commit
2382d05fb2
1 changed files with 2 additions and 2 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue