@@ -61,7 +61,7 @@ use crate::ln::channel::QuiescentAction;
61
61
use crate::ln::channel::{
62
62
self, hold_time_since, Channel, ChannelError, ChannelUpdateStatus, FundedChannel,
63
63
InboundV1Channel, OutboundV1Channel, PendingV2Channel, ReconnectionMsg, ShutdownResult,
64
- StfuResponse, UpdateFulfillCommitFetch, WithChannelContext,
64
+ SpliceFundingNegotiated, StfuResponse, UpdateFulfillCommitFetch, WithChannelContext,
65
65
};
66
66
use crate::ln::channel_state::ChannelDetails;
67
67
use crate::ln::funding::SpliceContribution;
@@ -6098,10 +6098,22 @@ where
6098
6098
.filter(|witness| !witness.is_empty())
6099
6099
.collect();
6100
6100
match chan.funding_transaction_signed(txid, witnesses) {
6101
- Ok((Some(tx_signatures), funding_tx_opt)) => {
6101
+ Ok((Some(tx_signatures), funding_tx_opt, splice_negotiated )) => {
6102
6102
if let Some(funding_tx) = funding_tx_opt {
6103
6103
self.broadcast_interactive_funding(chan, &funding_tx);
6104
6104
}
6105
+ if let Some(splice_negotiated) = splice_negotiated {
6106
+ self.pending_events.lock().unwrap().push_back((
6107
+ events::Event::SplicePending {
6108
+ channel_id: splice_negotiated.channel_id,
6109
+ counterparty_node_id: splice_negotiated.counterparty_node_id,
6110
+ user_channel_id: splice_negotiated.user_channel_id,
6111
+ funding_txo: splice_negotiated.funding_txo,
6112
+ channel_type: splice_negotiated.channel_type,
6113
+ },
6114
+ None,
6115
+ ));
6116
+ }
6105
6117
peer_state.pending_msg_events.push(
6106
6118
MessageSendEvent::SendTxSignatures {
6107
6119
node_id: *counterparty_node_id,
@@ -9154,16 +9166,28 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
9154
9166
} else {
9155
9167
let txid = signing_session.unsigned_tx().compute_txid();
9156
9168
match channel.funding_transaction_signed(txid, vec![]) {
9157
- Ok((Some(tx_signatures), funding_tx_opt)) => {
9169
+ Ok((Some(tx_signatures), funding_tx_opt, splice_negotiated )) => {
9158
9170
if let Some(funding_tx) = funding_tx_opt {
9159
9171
self.broadcast_interactive_funding(channel, &funding_tx);
9160
9172
}
9173
+ if let Some(splice_negotiated) = splice_negotiated {
9174
+ self.pending_events.lock().unwrap().push_back((
9175
+ events::Event::SplicePending {
9176
+ channel_id: splice_negotiated.channel_id,
9177
+ counterparty_node_id: splice_negotiated.counterparty_node_id,
9178
+ user_channel_id: splice_negotiated.user_channel_id,
9179
+ funding_txo: splice_negotiated.funding_txo,
9180
+ channel_type: splice_negotiated.channel_type,
9181
+ },
9182
+ None,
9183
+ ));
9184
+ }
9161
9185
pending_msg_events.push(MessageSendEvent::SendTxSignatures {
9162
9186
node_id: counterparty_node_id,
9163
9187
msg: tx_signatures,
9164
9188
});
9165
9189
},
9166
- Ok((None, _)) => {
9190
+ Ok((None, _, _ )) => {
9167
9191
debug_assert!(false, "If our tx_signatures is empty, then we should send it first!");
9168
9192
},
9169
9193
Err(err) => {
@@ -10109,7 +10133,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
10109
10133
hash_map::Entry::Occupied(mut chan_entry) => {
10110
10134
match chan_entry.get_mut().as_funded_mut() {
10111
10135
Some(chan) => {
10112
- let (tx_signatures_opt, funding_tx_opt) = try_channel_entry!(self, peer_state, chan.tx_signatures(msg), chan_entry);
10136
+ let (tx_signatures_opt, funding_tx_opt, splice_negotiated ) = try_channel_entry!(self, peer_state, chan.tx_signatures(msg), chan_entry);
10113
10137
if let Some(tx_signatures) = tx_signatures_opt {
10114
10138
peer_state.pending_msg_events.push(MessageSendEvent::SendTxSignatures {
10115
10139
node_id: *counterparty_node_id,
@@ -10123,6 +10147,18 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
10123
10147
emit_channel_pending_event!(pending_events, chan);
10124
10148
}
10125
10149
}
10150
+ if let Some(splice_negotiated) = splice_negotiated {
10151
+ self.pending_events.lock().unwrap().push_back((
10152
+ events::Event::SplicePending {
10153
+ channel_id: splice_negotiated.channel_id,
10154
+ counterparty_node_id: splice_negotiated.counterparty_node_id,
10155
+ user_channel_id: splice_negotiated.user_channel_id,
10156
+ funding_txo: splice_negotiated.funding_txo,
10157
+ channel_type: splice_negotiated.channel_type,
10158
+ },
10159
+ None,
10160
+ ));
10161
+ }
10126
10162
},
10127
10163
None => {
10128
10164
let msg = "Got an unexpected tx_signatures message";
0 commit comments