You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Track HolderCommitmentTransaction in HolderFundingOutput
The `ChannelMonitor` and `OnchainTxHandler` have historically been tied
together, often tracking some of the same state twice. As we introduce
support for splices in the `ChannelMonitor`, we'd like to avoid leaking
some of those details to the `OnchainTxHandler`. Ultimately, the
`OnchainTxHandler` should stand on its own and support claiming funds
from multiple `ChannelMonitor`s, allowing us to save on fees by batching
aggregatable claims across multiple in-flight closing channels.
Once splices are supported, we may run into cases where we are
attempting to claim an output from a specific `FundingScope`, while also
having an additional pending `FundingScope` for a splice. If the pending
splice confirms over the output claim, we need to cancel the claim and
re-offer it with the set of relevant parameters in the new
`FundingScope`.
This commit tracks the `HolderCommitmentTransaction` for the specific
`FundingScope` the `HolderFundingOutput` claim originated from. This
allows us to remove the dependency on `OnchainTxHandler` when obtaining
the current `HolderCommitmentTransaction` and ensures any alternative
commitment transaction state due to splicing does not leak into the
`OnchainTxHandler`. As a result, we can now include all the information
required to emit a `BumpTransactionEvent::ChannelClose` within its
intermediate representation `ClaimEvent::BumpCommitment`, as opposed to
relying on the `ChannelMonitor` to provide it.
let sig = self.signer.unsafe_sign_holder_commitment(&self.channel_transaction_parameters,&self.holder_commitment,&self.secp_ctx).expect("sign holder commitment");
@@ -1410,7 +1421,7 @@ mod tests {
1410
1421
let logger = TestLogger::new();
1411
1422
1412
1423
// Request claiming of each HTLC on the holder's commitment, with current block height 1.
1413
-
let holder_commit_txid = tx_handler.get_unsigned_holder_commitment_tx().compute_txid();
1424
+
let holder_commit_txid = tx_handler.current_holder_commitment_tx().trust().txid();
0 commit comments