Skip to content

Commit

Permalink
routing: fix mc blinded path behaviour.
Browse files Browse the repository at this point in the history
Because we hot swap the target public key when sending to a
blinded path we need to penalize all nodes after the introduction
point.
  • Loading branch information
ziggie1984 committed Nov 27, 2024
1 parent 41c2521 commit d2c031e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions routing/result_interpretation.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,11 +517,15 @@ func (i *interpretedResult) processPaymentOutcomeIntermediate(route *mcRoute,
if introIdx == len(route.hops.Val)-1 {
i.finalFailureReason = &reasonError
} else {
// If there are other hops between the recipient and
// introduction node, then we just penalize the last
// hop in the blinded route to minimize the storage of
// results for ephemeral keys.
i.failPairBalance(route, len(route.hops.Val)-1)
// Penalize all hops after the introduction node up to
// the final recipient. We cannot just penalize the
// last hop because when sending a paymenet we hot swap
// the target pubkey for a temporary one, so without
// penalizing all hops because the last hop does not
// really have an effect on our pathfinding.
i.failPairRange(
route, introIdx, len(route.hops.Val)-1,
)
}

// In all other cases, we penalize the reporting node. These are all
Expand Down

0 comments on commit d2c031e

Please sign in to comment.