-
Notifications
You must be signed in to change notification settings - Fork 412
Contribute funding inputs on accepting dual-funded channel #3735
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
base: main
Are you sure you want to change the base?
Conversation
👋 Thanks for assigning @jkczyz as a reviewer! |
e22fa33
to
fabbf86
Compare
c42f3d0
to
186d66b
Compare
186d66b
to
c7d8e89
Compare
c7d8e89
to
540b8a7
Compare
Looks like this needs a rebase after #3637 |
540b8a7
to
94bf848
Compare
ugh right! |
Don't the first three commits need to be dropped? |
67504f0
to
9f276d8
Compare
Just needs node reload tests but it can still get some initial review. |
When receiving a commitment_signed message, if there are any pending splices then we are expected to receive the message as a part of a batch. Otherwise, the spec dictates that we should send an error and fail the channel.
The `FundingTransactionReadyForSignatures` event requests witnesses from the client for their contributed inputs to an interactively constructed transaction. The client calls `ChannelManager::funding_transaction_signed` to provide the witnesses to LDK.
…annel We introduce a `ChannelManager::accept_inbound_channel_with_contribution` method allowing contributing to the overall channel capacity of an inbound dual-funded channel by contributing inputs.
9f276d8
to
60f58b1
Compare
{ | ||
if self.is_awaiting_initial_mon_persist() { | ||
log_debug!(logger, "Not sending tx_signatures: a monitor update is in progress. Setting monitor_pending_tx_signatures."); | ||
self.context.monitor_pending_tx_signatures = Some(holder_tx_signatures); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on just tracking this as an Option<()>
and we get the message from the signing session instead?
/// </div> | ||
pub fn funding_transaction_signed( | ||
&self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, transaction: Transaction, | ||
) -> Result<(), APIError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to acquire the PersistenceNotifierGuard
throughout this method
|
||
fn length_limit_holder_input_prev_txs( | ||
funding_inputs: Vec<(TxIn, Transaction, Weight)>, | ||
) -> Result<Vec<(TxIn, TransactionU16LenLimited, Weight)>, APIError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's return a structured type here that also includes the corresponding TxOut
as a field so we don't have to continue doing checks that it exists everywhere.
@@ -11110,6 +11111,31 @@ where | |||
script_pubkey: funding.get_funding_redeemscript().to_p2wsh(), | |||
}; | |||
|
|||
// Optionally add change output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this already be covered by begin_interactive_funding_tx_construction
?
@@ -11110,6 +11111,31 @@ where | |||
script_pubkey: funding.get_funding_redeemscript().to_p2wsh(), | |||
}; | |||
|
|||
// Optionally add change output | |||
let change_script = signer_provider.get_destination_script(context.channel_keys_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe let the user optionally provide a change address along with their inputs?
Since the |
Very WIP with upcoming commits.
Based on #3637.