mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2026-02-15 19:44:31 +01:00
htlcswitch: switch ackDownStreamPackets order with contract update call
This commit modifies updateCommitTx to error with ErrLinkShuttingDown when we try to send a ContractUpdate on the htlcUpdates chan and the link has closed the quit chan. It also changes the order of the call to ackDownStreamPackets and contract update call for consistency since the packets should be acknowledged before the link goes down.
This commit is contained in:
@@ -2060,6 +2060,10 @@ func (l *channelLink) updateCommitTx() error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := l.ackDownStreamPackets(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// The remote party now has a new pending commitment, so we'll update
|
||||
// the contract court to be aware of this new set (the prior old remote
|
||||
// pending).
|
||||
@@ -2069,11 +2073,7 @@ func (l *channelLink) updateCommitTx() error {
|
||||
Htlcs: pendingHTLCs,
|
||||
}:
|
||||
case <-l.quit:
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := l.ackDownStreamPackets(); err != nil {
|
||||
return err
|
||||
return ErrLinkShuttingDown
|
||||
}
|
||||
|
||||
commitSig := &lnwire.CommitSig{
|
||||
|
||||
Reference in New Issue
Block a user