-
Notifications
You must be signed in to change notification settings - Fork 456
Include interactive funding candidates on broadcast #4570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,8 @@ use bitcoin::{secp256k1, sighash, FeeRate, Sequence, TxIn}; | |
|
|
||
| use crate::blinded_path::message::BlindedMessagePath; | ||
| use crate::chain::chaininterface::{ | ||
| ConfirmationTarget, FeeEstimator, LowerBoundedFeeEstimator, TransactionType, | ||
| ChannelFunding, ConfirmationTarget, FeeEstimator, FundingCandidate, FundingPurpose, | ||
| LowerBoundedFeeEstimator, TransactionType, | ||
| }; | ||
| use crate::chain::channelmonitor::{ | ||
| ChannelMonitor, ChannelMonitorUpdate, ChannelMonitorUpdateStep, CommitmentHTLCData, | ||
|
|
@@ -9382,10 +9383,34 @@ where | |
| ); | ||
| } | ||
|
|
||
| let tx_type = TransactionType::Splice { | ||
| counterparty_node_id: self.context.counterparty_node_id, | ||
| channel_id: self.context.channel_id, | ||
| }; | ||
| let contrib_offset = pending_splice | ||
| .negotiated_candidates | ||
| .len() | ||
| .saturating_sub(pending_splice.contributions.len()); | ||
| let candidates = pending_splice | ||
| .negotiated_candidates | ||
| .iter() | ||
| .enumerate() | ||
| .map(|(i, funding)| { | ||
| let txid = funding | ||
| .get_funding_txid() | ||
| .expect("negotiated candidates should have a funding txid"); | ||
| let contribution = i | ||
| .checked_sub(contrib_offset) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't the offset always 0 here? We're currently exchanging
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The offset is for indexing into |
||
| .and_then(|j| pending_splice.contributions.get(j)) | ||
| .cloned(); | ||
| FundingCandidate { | ||
| txid, | ||
| channels: vec![ChannelFunding { | ||
| counterparty_node_id: self.context.counterparty_node_id, | ||
| channel_id: self.context.channel_id, | ||
| purpose: FundingPurpose::Splice, | ||
| contribution, | ||
| }], | ||
| } | ||
| }) | ||
| .collect(); | ||
| let tx_type = TransactionType::InteractiveFunding { candidates }; | ||
| funding_tx_signed.funding_tx = Some((funding_tx, tx_type)); | ||
| funding_tx_signed.splice_negotiated = Some(splice_negotiated); | ||
| funding_tx_signed.splice_locked = splice_locked; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.