Skip to content

Commit 81cd590

Browse files
ben-kaufmanclaude
andcommitted
fix: force direct route for healing payments
Set max_total_routing_fee_msat = 0 to prevent the router from picking a multi-hop route through a different channel, which would heal the wrong monitor. With zero max fee, only the direct (zero-fee) route to the counterparty is used. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e2af5c9 commit 81cd590

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,10 +712,13 @@ impl Node {
712712
// the monitor. Cost: 1 sat per counterparty if keysend succeeds.
713713
let send_heal_payment = |node_id: bitcoin::secp256k1::PublicKey| {
714714
let payment_id = PaymentId(keys_manager.get_secure_random_bytes());
715-
let route_params = RouteParameters::from_payment_params_and_value(
715+
let mut route_params = RouteParameters::from_payment_params_and_value(
716716
PaymentParameters::from_node_id(node_id, 144),
717717
1_000, // 1 sat
718718
);
719+
// Force direct route only — prevent routing through a different channel
720+
// which would heal the wrong monitor.
721+
route_params.max_total_routing_fee_msat = Some(0);
719722
channel_manager.send_spontaneous_payment(
720723
None,
721724
RecipientOnionFields::spontaneous_empty(),

0 commit comments

Comments
 (0)