Skip to content

Commit 333be69

Browse files
Tweak OnionMessenger log on inbound onion message receipt
1 parent 75fd0f3 commit 333be69

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

fuzz/src/onion_message.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ mod tests {
155155
super::do_test(&::hex::decode(one_hop_om).unwrap(), &logger);
156156
{
157157
let log_entries = logger.lines.lock().unwrap();
158-
assert_eq!(log_entries.get(&("lightning::onion_message::messenger".to_string(), "Received an onion message with path_id: None and no reply_path".to_string())), Some(&1));
158+
assert_eq!(log_entries.get(&("lightning::onion_message::messenger".to_string(),
159+
"Received an onion message with path_id None and no reply_path".to_string())), Some(&1));
159160
}
160161

161162
let two_unblinded_hops_om = "020000000000000000000000000000000000000000000000000000000000000e01055600020000000000000000000000000000000000000000000000000000000000000e0135043304210200000000000000000000000000000000000000000000000000000000000000039500000000000000000000000000000058000000000000000000000000000000000000000000000000000000000000001204105e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b300000000000000000000000000000000000000000000000000000000000000";

lightning/src/onion_message/functional_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ fn reply_path() {
197197
// Make sure the last node successfully decoded the reply path.
198198
nodes[3].logger.assert_log_contains(
199199
"lightning::onion_message::messenger".to_string(),
200-
format!("Received an onion message with path_id: None and reply_path").to_string(), 1);
200+
format!("Received an onion message with path_id None and a reply_path").to_string(), 1);
201201

202202
// Destination::BlindedRoute
203203
let blinded_route = BlindedRoute::new(&[nodes[1].get_node_pk(), nodes[2].get_node_pk(), nodes[3].get_node_pk()], &*nodes[3].keys_manager, &secp_ctx).unwrap();
@@ -207,7 +207,7 @@ fn reply_path() {
207207
pass_along_path(&nodes, None);
208208
nodes[3].logger.assert_log_contains(
209209
"lightning::onion_message::messenger".to_string(),
210-
format!("Received an onion message with path_id: None and reply_path").to_string(), 2);
210+
format!("Received an onion message with path_id None and a reply_path").to_string(), 2);
211211
}
212212

213213
#[test]

lightning/src/onion_message/messenger.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ impl<Signer: Sign, K: Deref, L: Deref, CMH: Deref> OnionMessageHandler for Onion
306306
control_tlvs: ReceiveControlTlvs::Unblinded(ReceiveTlvs { path_id }), reply_path,
307307
}, None)) => {
308308
log_info!(self.logger,
309-
"Received an onion message with path_id: {:02x?} and {}reply_path",
310-
path_id, if reply_path.is_some() { "" } else { "no " });
309+
"Received an onion message with path_id {:02x?} and {} reply_path",
310+
path_id, if reply_path.is_some() { "a" } else { "no" });
311311
},
312312
Ok((Payload::Forward(ForwardControlTlvs::Unblinded(ForwardTlvs {
313313
next_node_id, next_blinding_override

0 commit comments

Comments
 (0)