|
10 | 10 | use crate::blinded_path::BlindedHop;
|
11 | 11 | use crate::crypto::chacha20::ChaCha20;
|
12 | 12 | use crate::crypto::streams::ChaChaReader;
|
| 13 | +use crate::ln::channel::TOTAL_BITCOIN_SUPPLY_SATOSHIS; |
13 | 14 | use crate::ln::channelmanager::{HTLCSource, RecipientOnionFields};
|
14 | 15 | use crate::ln::features::{ChannelFeatures, NodeFeatures};
|
15 | 16 | use crate::ln::msgs;
|
16 | 17 | use crate::ln::types::{PaymentHash, PaymentPreimage};
|
17 | 18 | use crate::ln::wire::Encode;
|
18 | 19 | use crate::routing::gossip::NetworkUpdate;
|
19 |
| -use crate::routing::router::{ |
20 |
| - Path, RouteHop, RouteParameters, DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA, MAX_PATH_LENGTH_ESTIMATE, |
21 |
| -}; |
| 20 | +use crate::routing::router::{Path, RouteHop, RouteParameters, MAX_PATH_LENGTH_ESTIMATE}; |
22 | 21 | use crate::sign::NodeSigner;
|
23 | 22 | use crate::util::errors::{self, APIError};
|
24 | 23 | use crate::util::logger::Logger;
|
@@ -322,8 +321,8 @@ pub(crate) fn set_max_path_length(
|
322 | 321 | const PAYLOAD_HMAC_LEN: usize = 32;
|
323 | 322 | let unblinded_intermed_payload_len = msgs::OutboundOnionPayload::Forward {
|
324 | 323 | short_channel_id: 42,
|
325 |
| - amt_to_forward: u64::max_value(), |
326 |
| - outgoing_cltv_value: u32::max_value(), |
| 324 | + amt_to_forward: TOTAL_BITCOIN_SUPPLY_SATOSHIS, |
| 325 | + outgoing_cltv_value: route_params.payment_params.max_total_cltv_expiry_delta, |
327 | 326 | }
|
328 | 327 | .serialized_length()
|
329 | 328 | .saturating_add(PAYLOAD_HMAC_LEN);
|
@@ -358,7 +357,7 @@ pub(crate) fn set_max_path_length(
|
358 | 357 | short_channel_id: 42,
|
359 | 358 | channel_features: ChannelFeatures::empty(),
|
360 | 359 | fee_msat: final_value_msat_with_overpay_buffer,
|
361 |
| - cltv_expiry_delta: DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA, |
| 360 | + cltv_expiry_delta: route_params.payment_params.max_total_cltv_expiry_delta, |
362 | 361 | maybe_announced_channel: false,
|
363 | 362 | };
|
364 | 363 | let mut num_reserved_bytes: usize = 0;
|
|
0 commit comments