Skip to content

Commit

Permalink
Set logging metadata when we fail to apply a ChannelMonitorUpdate
Browse files Browse the repository at this point in the history
Now that we provide the counterparty node id, we can set logging
metadata with a counterparty node id and and channel id, which we
do here.
  • Loading branch information
TheBlueMatt committed Dec 12, 2023
1 parent 07b5355 commit 1bee708
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lightning/src/chain/chainmonitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use crate::sign::ecdsa::WriteableEcdsaChannelSigner;
use crate::events;
use crate::events::{Event, EventHandler};
use crate::util::atomic_counter::AtomicCounter;
use crate::util::logger::Logger;
use crate::util::logger::{Logger, WithContext};
use crate::util::errors::APIError;
use crate::util::wakers::{Future, Notifier};
use crate::ln::channelmanager::ChannelDetails;
Expand Down Expand Up @@ -757,7 +757,8 @@ where C::Target: chain::Filter,
let monitors = self.monitors.read().unwrap();
match monitors.get(&funding_txo) {
None => {
log_error!(self.logger, "Failed to update channel monitor: no such monitor registered");
let logger = WithContext::from(&self.logger, update.counterparty_node_id, Some(funding_txo.to_channel_id()));
log_error!(logger, "Failed to update channel monitor: no such monitor registered");

// We should never ever trigger this from within ChannelManager. Technically a
// user could use this object with some proxying in between which makes this
Expand Down

0 comments on commit 1bee708

Please sign in to comment.