Skip to content

Commit 793a1bf

Browse files
committed
Derive Debug and Display for Route
1 parent 1ac53ed commit 793a1bf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lightning/src/routing/router.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ impl Path {
341341

342342
/// A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
343343
/// it can take multiple paths. Each path is composed of one or more hops through the network.
344-
#[derive(Clone, Hash, PartialEq, Eq)]
344+
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
345345
pub struct Route {
346346
/// The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
347347
/// [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
@@ -380,6 +380,12 @@ impl Route {
380380
}
381381
}
382382

383+
impl fmt::Display for Route {
384+
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
385+
log_route!(self).fmt(f)
386+
}
387+
}
388+
383389
const SERIALIZATION_VERSION: u8 = 1;
384390
const MIN_SERIALIZATION_VERSION: u8 = 1;
385391

0 commit comments

Comments
 (0)