From: Matt Corallo Date: Fri, 1 Dec 2023 21:56:43 +0000 (+0000) Subject: Set logging metadata when we fail to apply a `ChannelMonitorUpdate` X-Git-Tag: v0.0.119~2^2~1 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=1bee708742604fa7993625af7bf6d57d86a398d0;p=rust-lightning Set logging metadata when we fail to apply a `ChannelMonitorUpdate` 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. --- diff --git a/lightning/src/chain/chainmonitor.rs b/lightning/src/chain/chainmonitor.rs index 09a32b6e2..145447543 100644 --- a/lightning/src/chain/chainmonitor.rs +++ b/lightning/src/chain/chainmonitor.rs @@ -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; @@ -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