Browse Source

pay: Change origin_index to erring_index, start with local node = 0.

ppa-0.6.1
ZmnSCPxj 7 years ago
committed by Christian Decker
parent
commit
d4478458dd
  1. 6
      doc/lightning-pay.7
  2. 6
      doc/lightning-pay.7.txt
  3. 6
      doc/lightning-sendpay.7
  4. 6
      doc/lightning-sendpay.7.txt
  5. 10
      lightningd/pay.c

6
doc/lightning-pay.7

@ -2,12 +2,12 @@
.\" Title: lightning-pay
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 02/05/2018
.\" Date: 02/06/2018
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "LIGHTNING\-PAY" "7" "02/05/2018" "\ \&" "\ \&"
.TH "LIGHTNING\-PAY" "7" "02/06/2018" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@ -146,7 +146,7 @@ A routing failure object has the fields below:
.sp -1
.IP \(bu 2.3
.\}
\fIorigin_index\fR\&. The index of the node along the route that reported the error\&. 0 for the first hop node, \-1 if the local node reported the error\&.
\fIerring_index\fR\&. The index of the node along the route that reported the error\&. 0 for the local node, 1 for the first hop, and so on\&.
.RE
.sp
.RS 4

6
doc/lightning-pay.7.txt

@ -52,9 +52,9 @@ The following error codes may occur:
A routing failure object has the fields below:
* 'origin_index'. The index of the node along the route that
reported the error. 0 for the first hop node, -1 if the local
node reported the error.
* 'erring_index'. The index of the node along the route that
reported the error. 0 for the local node, 1 for the first
hop, and so on.
* 'erring_node'. The hex string of the pubkey id of the node
that reported the error.
* 'erring_channel'. The short channel ID of the channel that

6
doc/lightning-sendpay.7

@ -2,12 +2,12 @@
.\" Title: lightning-sendpay
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 02/05/2018
.\" Date: 02/06/2018
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "LIGHTNING\-SENDPAY" "7" "02/05/2018" "\ \&" "\ \&"
.TH "LIGHTNING\-SENDPAY" "7" "02/06/2018" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@ -137,7 +137,7 @@ A routing failure object has the fields below:
.sp -1
.IP \(bu 2.3
.\}
\fIorigin_index\fR\&. The index of the node along the route that reported the error\&. 0 for the first hop node, \-1 if the local node reported the error\&.
\fIerring_index\fR\&. The index of the node along the route that reported the error\&. 0 for the local node, 1 for the first hop, and so on\&.
.RE
.sp
.RS 4

6
doc/lightning-sendpay.7.txt

@ -52,9 +52,9 @@ The following error codes may occur:
A routing failure object has the fields below:
* 'origin_index'. The index of the node along the route that
reported the error. 0 for the first hop node, -1 if the local
node reported the error.
* 'erring_index'. The index of the node along the route that
reported the error. 0 for the local node, 1 for the first
hop, and so on.
* 'erring_node'. The hex string of the pubkey id of the node
that reported the error.
* 'erring_channel'. The short channel ID of the channel that

10
lightningd/pay.c

@ -75,7 +75,7 @@ static void json_pay_success(struct lightningd *ld,
}
struct routing_failure {
int origin_index;
unsigned int erring_index;
enum onion_type failcode;
struct pubkey erring_node;
struct short_channel_id erring_channel;
@ -100,7 +100,7 @@ json_pay_command_routing_failed(struct command *cmd,
json_object_start(data, NULL);
if (fail) {
failure_code = fail->failcode;
json_add_snum(data, "origin_index", fail->origin_index);
json_add_num(data, "erring_index", fail->erring_index);
json_add_num(data, "failcode", (unsigned) fail->failcode);
json_add_hex(data, "erring_node",
&fail->erring_node, sizeof(fail->erring_node));
@ -203,7 +203,7 @@ immediate_routing_failure(const tal_t *ctx,
assert(failcode);
routing_failure = tal(ctx, struct routing_failure);
routing_failure->origin_index = -1;
routing_failure->erring_index = 0;
routing_failure->failcode = failcode;
routing_failure->erring_node = ld->id;
routing_failure->erring_channel = *channel0;
@ -225,7 +225,7 @@ local_routing_failure(const tal_t *ctx,
assert(hout->failcode);
routing_failure = tal(ctx, struct routing_failure);
routing_failure->origin_index = -1;
routing_failure->erring_index = 0;
routing_failure->failcode = hout->failcode;
routing_failure->erring_node = ld->id;
routing_failure->erring_channel = payment->route_channels[0];
@ -295,7 +295,7 @@ remote_routing_failure(const tal_t *ctx,
erring_node = &route_nodes[origin_index];
routing_failure->origin_index = origin_index;
routing_failure->erring_index = (unsigned int) (origin_index + 1);
routing_failure->failcode = failcode;
routing_failure->erring_node = *erring_node;
routing_failure->erring_channel = *erring_channel;

Loading…
Cancel
Save