Skip to content

Commit 1634ad0

Browse files
committed
f Account for updated payment params interface
1 parent 64f4216 commit 1634ad0

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

src/builder.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,12 +658,14 @@ fn build_with_store_internal<K: KVStore + Sync + Send + 'static>(
658658
route_handler: Arc::clone(&p2p_gossip_sync)
659659
as Arc<dyn RoutingMessageHandler + Sync + Send>,
660660
onion_message_handler: onion_messenger,
661+
custom_message_handler: IgnoringMessageHandler {},
661662
},
662663
GossipSync::Rapid(_) => MessageHandler {
663664
chan_handler: Arc::clone(&channel_manager),
664665
route_handler: Arc::new(IgnoringMessageHandler {})
665666
as Arc<dyn RoutingMessageHandler + Sync + Send>,
666667
onion_message_handler: onion_messenger,
668+
custom_message_handler: IgnoringMessageHandler {},
667669
},
668670
GossipSync::None => {
669671
unreachable!("We must always have a gossip sync!");
@@ -675,7 +677,6 @@ fn build_with_store_internal<K: KVStore + Sync + Send + 'static>(
675677
cur_time.as_secs().try_into().map_err(|_| BuildError::InvalidSystemTime)?,
676678
&ephemeral_bytes,
677679
Arc::clone(&logger),
678-
IgnoringMessageHandler {},
679680
Arc::clone(&keys_manager),
680681
));
681682

src/lib.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,9 +1147,12 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
11471147
invoice.min_final_cltv_expiry_delta() as u32,
11481148
)
11491149
.with_expiry_time(expiry_time.as_secs())
1150-
.with_route_hints(invoice.route_hints());
1150+
.with_route_hints(invoice.route_hints())
1151+
.map_err(|_| Error::InvalidInvoice)?;
11511152
if let Some(features) = invoice.features() {
1152-
payment_params = payment_params.with_features(features.clone());
1153+
payment_params = payment_params
1154+
.with_bolt11_features(features.clone())
1155+
.map_err(|_| Error::InvalidInvoice)?;
11531156
}
11541157
let route_params = RouteParameters { payment_params, final_value_msat: amount_msat };
11551158

@@ -1313,9 +1316,12 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
13131316
invoice.min_final_cltv_expiry_delta() as u32,
13141317
)
13151318
.with_expiry_time(expiry_time.as_secs())
1316-
.with_route_hints(invoice.route_hints());
1319+
.with_route_hints(invoice.route_hints())
1320+
.map_err(|_| Error::InvalidInvoice)?;
13171321
if let Some(features) = invoice.features() {
1318-
payment_params = payment_params.with_features(features.clone());
1322+
payment_params = payment_params
1323+
.with_bolt11_features(features.clone())
1324+
.map_err(|_| Error::InvalidInvoice)?;
13191325
}
13201326
let route_params = RouteParameters { payment_params, final_value_msat: amount_msat };
13211327

@@ -1356,7 +1362,7 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
13561362
&payer,
13571363
&route_params,
13581364
Some(&first_hops.iter().collect::<Vec<_>>()),
1359-
&inflight_htlcs,
1365+
inflight_htlcs,
13601366
)
13611367
.map_err(|e| {
13621368
log_error!(self.logger, "Failed to find path for payment probe: {:?}", e);

0 commit comments

Comments
 (0)