Skip to content

Commit ec0d282

Browse files
committed
f rename return variable and note about locktime in the unsafe variant
1 parent 74b5d58 commit ec0d282

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,7 +1898,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
18981898
self.holder_tx_signed = true;
18991899
let commitment_tx = self.onchain_tx_handler.get_fully_signed_holder_tx(&self.funding_redeemscript);
19001900
let txid = commitment_tx.txid();
1901-
let mut res = vec![commitment_tx];
1901+
let mut holder_transactions = vec![commitment_tx];
19021902
for htlc in self.current_holder_commitment_tx.htlc_outputs.iter() {
19031903
if let Some(vout) = htlc.0.transaction_output_index {
19041904
let preimage = if !htlc.0.offered {
@@ -1916,21 +1916,22 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
19161916
} else { None };
19171917
if let Some(htlc_tx) = self.onchain_tx_handler.get_fully_signed_htlc_tx(
19181918
&::bitcoin::OutPoint { txid, vout }, &preimage) {
1919-
res.push(htlc_tx);
1919+
holder_transactions.push(htlc_tx);
19201920
}
19211921
}
19221922
}
19231923
// We throw away the generated waiting_first_conf data as we aren't (yet) confirmed and we don't actually know what the caller wants to do.
19241924
// The data will be re-generated and tracked in check_spend_holder_transaction if we get a confirmation.
1925-
return res;
1925+
holder_transactions
19261926
}
19271927

19281928
#[cfg(any(test,feature = "unsafe_revoked_tx_signing"))]
1929+
/// Note that this includes possibly-locktimed-in-the-future transactions!
19291930
fn unsafe_get_latest_holder_commitment_txn<L: Deref>(&mut self, logger: &L) -> Vec<Transaction> where L::Target: Logger {
19301931
log_trace!(logger, "Getting signed copy of latest holder commitment transaction!");
19311932
let commitment_tx = self.onchain_tx_handler.get_fully_signed_copy_holder_tx(&self.funding_redeemscript);
19321933
let txid = commitment_tx.txid();
1933-
let mut res = vec![commitment_tx];
1934+
let mut holder_transactions = vec![commitment_tx];
19341935
for htlc in self.current_holder_commitment_tx.htlc_outputs.iter() {
19351936
if let Some(vout) = htlc.0.transaction_output_index {
19361937
let preimage = if !htlc.0.offered {
@@ -1941,11 +1942,11 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
19411942
} else { None };
19421943
if let Some(htlc_tx) = self.onchain_tx_handler.unsafe_get_fully_signed_htlc_tx(
19431944
&::bitcoin::OutPoint { txid, vout }, &preimage) {
1944-
res.push(htlc_tx);
1945+
holder_transactions.push(htlc_tx);
19451946
}
19461947
}
19471948
}
1948-
return res
1949+
holder_transactions
19491950
}
19501951

19511952
pub fn block_connected<B: Deref, F: Deref, L: Deref>(&mut self, header: &BlockHeader, txdata: &TransactionData, height: u32, broadcaster: B, fee_estimator: F, logger: L) -> Vec<TransactionOutputs>

0 commit comments

Comments
 (0)