mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-03-15 15:39:09 +01:00
Lean on Logger
wrapping in ChannelMonitor
rather than in channel
Now that `ChannelMonitor` is careful about wrapping `Logger`s at the edge, there's no need to use `WithChannelMonitor` in a few cases in `channel.rs` and one in `channelmanager.rs`.
This commit is contained in:
parent
65e37fdc29
commit
de480d0212
2 changed files with 4 additions and 7 deletions
|
@ -35,7 +35,7 @@ use crate::ln::chan_utils;
|
|||
use crate::ln::onion_utils::HTLCFailReason;
|
||||
use crate::chain::BestBlock;
|
||||
use crate::chain::chaininterface::{FeeEstimator, ConfirmationTarget, LowerBoundedFeeEstimator};
|
||||
use crate::chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, ChannelMonitorUpdateStep, WithChannelMonitor, LATENCY_GRACE_PERIOD_BLOCKS, CLOSED_CHANNEL_UPDATE_ID};
|
||||
use crate::chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, ChannelMonitorUpdateStep, LATENCY_GRACE_PERIOD_BLOCKS, CLOSED_CHANNEL_UPDATE_ID};
|
||||
use crate::chain::transaction::{OutPoint, TransactionData};
|
||||
use crate::sign::ecdsa::{EcdsaChannelSigner, WriteableEcdsaChannelSigner};
|
||||
use crate::sign::{EntropySource, ChannelSigner, SignerProvider, NodeSigner, Recipient};
|
||||
|
@ -2773,14 +2773,13 @@ impl<SP: Deref> Channel<SP> where
|
|||
funding_redeemscript.clone(), self.context.channel_value_satoshis,
|
||||
obscure_factor,
|
||||
holder_commitment_tx, best_block, self.context.counterparty_node_id);
|
||||
let logger_with_chan_monitor = WithChannelMonitor::from(logger, &channel_monitor);
|
||||
channel_monitor.provide_initial_counterparty_commitment_tx(
|
||||
counterparty_initial_bitcoin_tx.txid, Vec::new(),
|
||||
self.context.cur_counterparty_commitment_transaction_number,
|
||||
self.context.counterparty_cur_commitment_point.unwrap(),
|
||||
counterparty_initial_commitment_tx.feerate_per_kw(),
|
||||
counterparty_initial_commitment_tx.to_broadcaster_value_sat(),
|
||||
counterparty_initial_commitment_tx.to_countersignatory_value_sat(), &&logger_with_chan_monitor);
|
||||
counterparty_initial_commitment_tx.to_countersignatory_value_sat(), logger);
|
||||
|
||||
assert_eq!(self.context.channel_state & (ChannelState::MonitorUpdateInProgress as u32), 0); // We have no had any monitor(s) yet to fail update!
|
||||
if self.context.is_batch_funding() {
|
||||
|
@ -6976,13 +6975,12 @@ impl<SP: Deref> InboundV1Channel<SP> where SP::Target: SignerProvider {
|
|||
funding_redeemscript.clone(), self.context.channel_value_satoshis,
|
||||
obscure_factor,
|
||||
holder_commitment_tx, best_block, self.context.counterparty_node_id);
|
||||
let logger_with_chan_monitor = WithChannelMonitor::from(logger, &channel_monitor);
|
||||
channel_monitor.provide_initial_counterparty_commitment_tx(
|
||||
counterparty_initial_commitment_tx.trust().txid(), Vec::new(),
|
||||
self.context.cur_counterparty_commitment_transaction_number + 1,
|
||||
self.context.counterparty_cur_commitment_point.unwrap(), self.context.feerate_per_kw,
|
||||
counterparty_initial_commitment_tx.to_broadcaster_value_sat(),
|
||||
counterparty_initial_commitment_tx.to_countersignatory_value_sat(), &&logger_with_chan_monitor);
|
||||
counterparty_initial_commitment_tx.to_countersignatory_value_sat(), logger);
|
||||
|
||||
log_info!(logger, "{} funding_signed for peer for channel {}",
|
||||
if funding_signed.is_some() { "Generated" } else { "Waiting for signature on" }, &self.context.channel_id());
|
||||
|
|
|
@ -10711,8 +10711,7 @@ where
|
|||
}
|
||||
}
|
||||
if let Some(previous_hop_monitor) = args.channel_monitors.get(&claimable_htlc.prev_hop.outpoint) {
|
||||
let logger = WithChannelMonitor::from(&args.logger, previous_hop_monitor);
|
||||
previous_hop_monitor.provide_payment_preimage(&payment_hash, &payment_preimage, &args.tx_broadcaster, &bounded_fee_estimator, &&logger);
|
||||
previous_hop_monitor.provide_payment_preimage(&payment_hash, &payment_preimage, &args.tx_broadcaster, &bounded_fee_estimator, &args.logger);
|
||||
}
|
||||
}
|
||||
pending_events_read.push_back((events::Event::PaymentClaimed {
|
||||
|
|
Loading…
Add table
Reference in a new issue