mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
pay: don't list dummy channel if error is from final hop.
List the final one instead; if there's an error from the node it may actually make sense to blame that channel (ie. previous node did something wrong). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
4e6b8e13a4
commit
f8ecd08721
@@ -297,7 +297,6 @@ remote_routing_failure(const tal_t *ctx,
|
||||
const struct pubkey *erring_node;
|
||||
const struct short_channel_id *route_channels;
|
||||
const struct short_channel_id *erring_channel;
|
||||
static const struct short_channel_id dummy_channel = { 0 };
|
||||
int origin_index;
|
||||
int dir;
|
||||
|
||||
@@ -310,9 +309,15 @@ remote_routing_failure(const tal_t *ctx,
|
||||
|
||||
/* Check if at destination. */
|
||||
if (origin_index == tal_count(route_nodes) - 1) {
|
||||
/* FIXME: Don't set erring_channel or dir in this case! */
|
||||
erring_channel = &dummy_channel;
|
||||
dir = 0;
|
||||
/* If any channel is to blame, it's the last one. */
|
||||
erring_channel = &route_channels[origin_index];
|
||||
/* Single hop? */
|
||||
if (origin_index == 0)
|
||||
dir = pubkey_idx(&ld->id,
|
||||
&route_nodes[origin_index]);
|
||||
else
|
||||
dir = pubkey_idx(&route_nodes[origin_index - 1],
|
||||
&route_nodes[origin_index]);
|
||||
|
||||
/* BOLT #4:
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user