Skip to content

Commit 8630d6c

Browse files
committed
f move recvd commit_sig check out of else & change close to warn for no active signing session
1 parent 1c4c322 commit 8630d6c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lightning/src/ln/channel.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7025,6 +7025,7 @@ impl<SP: Deref> FundedChannel<SP> where
70257025
update_fee: None,
70267026
})
70277027
} else { None };
7028+
// TODO(dual_funding): For async signing support we need to hold back `tx_signatures` until the `commitment_signed` is ready.
70287029
let tx_signatures = if (
70297030
// if it has not received tx_signatures for that funding transaction AND
70307031
// if it has already received commitment_signed AND it should sign first, as specified in the tx_signatures requirements:
@@ -7049,19 +7050,19 @@ impl<SP: Deref> FundedChannel<SP> where
70497050
session.holder_tx_signatures().clone()
70507051
}
70517052
} else {
7052-
if !session.has_received_commitment_signed() {
7053-
self.context.expecting_peer_commitment_signed = true;
7054-
}
70557053
None
70567054
};
7055+
if !session.has_received_commitment_signed() {
7056+
self.context.expecting_peer_commitment_signed = true;
7057+
}
70577058
(commitment_update, tx_signatures, None)
70587059
} else {
70597060
// The `next_funding_txid` does not match the latest interactive funding transaction so we
70607061
// MUST send tx_abort to let the remote know that they can forget this funding transaction.
70617062
(None, None, Some(msgs::TxAbort { channel_id: self.context.channel_id(), data: vec![] }))
70627063
}
70637064
} else {
7064-
return Err(ChannelError::close("Counterparty set `next_funding_txid` at incorrect state".into()));
7065+
return Err(ChannelError::Warn("No active signing session. The associated funding transaction may have already been broadcast.".into()));
70657066
}
70667067
} else {
70677068
// Don't send anything related to interactive signing if `next_funding_txid` is not set.

0 commit comments

Comments
 (0)