@@ -1437,7 +1437,8 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> {
1437
1437
/// justice transactions for any revoked commitment transactions. It's intended to be used
1438
1438
/// within an implementation of [`Persist::update_persisted_channel`], which is provided with
1439
1439
/// a monitor and an update. Note that this simply provides the counterparty commitment
1440
- /// transactions from an update, which may or may not have been revoked yet.
1440
+ /// transactions from an update, which may or may not have been revoked yet. Once revoked,
1441
+ /// signing a justice transaction can be done using [`Self::sign_justice_tx`].
1441
1442
///
1442
1443
/// It is expected that a watchtower may use this method to retrieve the latest counterparty
1443
1444
/// commitment transaction(s), and then hold the necessary data until a later update in which
@@ -1453,10 +1454,16 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> {
1453
1454
self . inner . lock ( ) . unwrap ( ) . counterparty_commitment_txs_from_update ( update)
1454
1455
}
1455
1456
1456
- /// Wrapper around [`crate::sign:: EcdsaChannelSigner::sign_justice_revoked_output`] to make
1457
+ /// Wrapper around [`EcdsaChannelSigner::sign_justice_revoked_output`] to make
1457
1458
/// signing the justice transaction easier for implementors of
1458
1459
/// [`chain::chainmonitor::Persist`]. On success this method returns a fully signed
1459
1460
/// transaction that is ready to be broadcasted.
1461
+ ///
1462
+ /// This method will only succeed if this monitor has received the revocation secret for the
1463
+ /// provided commitment number.
1464
+ ///
1465
+ /// [`EcdsaChannelSigner::sign_justice_revoked_output`]: crate::sign::EcdsaChannelSigner::sign_justice_revoked_output
1466
+ /// [`Persist`]: crate::chain::chainmonitor::Persist
1460
1467
pub fn sign_justice_tx ( & self , justice_tx : Transaction , input_idx : usize , value : u64 , commitment_number : u64 ) -> Result < Transaction , ( ) > {
1461
1468
self . inner . lock ( ) . unwrap ( ) . sign_justice_tx ( justice_tx, input_idx, value, commitment_number)
1462
1469
}
0 commit comments