Skip to content

Commit 1d779f9

Browse files
committed
Add has_trampoline_hops accessor to Path
Convenience method to reduce code duplication.
1 parent ae0196f commit 1d779f9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lightning/src/routing/router.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,11 @@ impl Path {
519519
None => self.hops.last().map(|hop| hop.cltv_expiry_delta)
520520
}
521521
}
522+
523+
/// True if this [`Path`] has at least one Trampoline hop.
524+
pub fn has_trampoline_hops(&self) -> bool {
525+
self.blinded_tail.as_ref().map_or(false, |bt| !bt.trampoline_hops.is_empty())
526+
}
522527
}
523528

524529
/// A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,

0 commit comments

Comments
 (0)