Skip to content

Commit 8f75caf

Browse files
Make MAX_PATH_LENGTH_ESTIMATE const pub and expand doc comment.
Will be used in the next commit when we make this configurable in PaymentParameters.
1 parent 60f0288 commit 8f75caf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lightning/src/routing/router.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,8 @@ const DEFAULT_MAX_CHANNEL_SATURATION_POW_HALF: u8 = 2;
654654
// The median hop CLTV expiry delta currently seen in the network.
655655
const MEDIAN_HOP_CLTV_EXPIRY_DELTA: u32 = 40;
656656

657+
/// Estimated maximum number of hops that can be included in a payment path. May be inaccurate if
658+
/// payment metadata, custom TLVs, or blinded paths are included in the payment.
657659
// During routing, we only consider paths shorter than our maximum length estimate.
658660
// In the TLV onion format, there is no fixed maximum length, but the `hop_payloads`
659661
// field is always 1300 bytes. As the `tlv_payload` for each hop may vary in length, we have to
@@ -665,7 +667,7 @@ const MEDIAN_HOP_CLTV_EXPIRY_DELTA: u32 = 40;
665667
// (payment_secret and total_msat) = 93 bytes for the final hop.
666668
// Since the length of the potentially included `payment_metadata` is unknown to us, we round
667669
// down from (1300-93) / 61 = 19.78... to arrive at a conservative estimate of 19.
668-
const MAX_PATH_LENGTH_ESTIMATE: u8 = 19;
670+
pub const MAX_PATH_LENGTH_ESTIMATE: u8 = 19;
669671

670672
/// Information used to route a payment.
671673
#[derive(Clone, Debug, Hash, PartialEq, Eq)]

0 commit comments

Comments
 (0)