chain: call unsub in Incoming* methods
This commit is contained in:
parent
ced47a11e7
commit
4ee2fc4d9f
@ -436,6 +436,8 @@ func (mp *MessagePool) Updates(ctx context.Context) (<-chan api.MpoolUpdate, err
|
||||
sub := mp.changes.Sub(localUpdates)
|
||||
|
||||
go func() {
|
||||
defer mp.changes.Unsub(sub, localIncoming)
|
||||
|
||||
for {
|
||||
select {
|
||||
case u := <-sub:
|
||||
|
@ -153,6 +153,8 @@ func (syncer *Syncer) IncomingBlocks(ctx context.Context) (<-chan *types.BlockHe
|
||||
out := make(chan *types.BlockHeader, 10)
|
||||
|
||||
go func() {
|
||||
defer syncer.incoming.Unsub(sub, localIncoming)
|
||||
|
||||
for {
|
||||
select {
|
||||
case r := <-sub:
|
||||
|
@ -7,7 +7,6 @@ import (
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
"gopkg.in/urfave/cli.v2"
|
||||
|
||||
)
|
||||
|
||||
var dotCmd = &cli.Command{
|
||||
|
Loading…
Reference in New Issue
Block a user