chain: call unsub in Incoming* methods

This commit is contained in:
Łukasz Magiera 2019-11-19 20:49:11 +01:00
parent ced47a11e7
commit 4ee2fc4d9f
3 changed files with 4 additions and 1 deletions

View File

@ -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:

View File

@ -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:

View File

@ -7,7 +7,6 @@ import (
"github.com/ipfs/go-cid"
"gopkg.in/urfave/cli.v2"
)
var dotCmd = &cli.Command{