mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-27 06:01:48 +02:00
brontide: fix peer disconnection issue
In case when the rbf coop close feature was active we would not properly disconnect the peer.
This commit is contained in:
@@ -3804,18 +3804,28 @@ func (p *Brontide) chanFlushEventSentinel(chanCloser *chancloser.RbfChanCloser,
|
|||||||
// We'll wait until the channel enters the ChannelFlushing state. We
|
// We'll wait until the channel enters the ChannelFlushing state. We
|
||||||
// exit after a success loop. As after the first RBF iteration, the
|
// exit after a success loop. As after the first RBF iteration, the
|
||||||
// channel will always be flushed.
|
// channel will always be flushed.
|
||||||
for newState := range newStateChan {
|
for {
|
||||||
if _, ok := newState.(*chancloser.ChannelFlushing); ok {
|
select {
|
||||||
peerLog.Infof("ChannelPoint(%v): rbf coop "+
|
case newState, ok := <-newStateChan:
|
||||||
"close is awaiting a flushed state, "+
|
if !ok {
|
||||||
"registering with link..., ",
|
return
|
||||||
channel.ChannelPoint())
|
}
|
||||||
|
|
||||||
// Request the link to send the event once the channel
|
if _, ok := newState.(*chancloser.ChannelFlushing); ok {
|
||||||
// is flushed. We only need this event sent once, so we
|
peerLog.Infof("ChannelPoint(%v): rbf coop "+
|
||||||
// can exit now.
|
"close is awaiting a flushed state, "+
|
||||||
link.OnFlushedOnce(sendChanFlushed)
|
"registering with link..., ",
|
||||||
|
channel.ChannelPoint())
|
||||||
|
|
||||||
|
// Request the link to send the event once the
|
||||||
|
// channel is flushed. We only need this event
|
||||||
|
// sent once, so we can exit now.
|
||||||
|
link.OnFlushedOnce(sendChanFlushed)
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
case <-p.cg.Done():
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user