mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-04 10:42:25 +02:00
lnd: manually set sig pending bit in commitment state machine
This commit fixes a class of bug which would trigger a never ending loop of “null” commitment updates between two peers.
This commit is contained in:
4
peer.go
4
peer.go
@@ -769,6 +769,7 @@ out:
|
|||||||
peerLog.Errorf("unable to update "+
|
peerLog.Errorf("unable to update "+
|
||||||
"commitment: %v", err)
|
"commitment: %v", err)
|
||||||
}
|
}
|
||||||
|
state.sigPending = true
|
||||||
}
|
}
|
||||||
case msg, ok := <-upstreamLink:
|
case msg, ok := <-upstreamLink:
|
||||||
// If the upstream message link is closed, this signals
|
// If the upstream message link is closed, this signals
|
||||||
@@ -890,6 +891,7 @@ out:
|
|||||||
"commitment: %v", err)
|
"commitment: %v", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
state.sigPending = true
|
||||||
state.htlcsToSettle = nil
|
state.htlcsToSettle = nil
|
||||||
}
|
}
|
||||||
case <-p.quit:
|
case <-p.quit:
|
||||||
@@ -921,8 +923,6 @@ func (p *peer) updateCommitTx(state *commitmentState) error {
|
|||||||
}
|
}
|
||||||
p.queueMsg(commitSig, nil)
|
p.queueMsg(commitSig, nil)
|
||||||
|
|
||||||
state.sigPending = true
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user