mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
paymod: Only wait on blockheight if we need to
We were wrongfully identifying all payment failures as blockheight mismatches.
This commit is contained in:
parent
817f7c703b
commit
b88a55b2a4
@ -1973,7 +1973,7 @@ static void waitblockheight_cb(void *d, struct payment *p)
|
|||||||
struct out_req *req;
|
struct out_req *req;
|
||||||
struct timeabs now = time_now();
|
struct timeabs now = time_now();
|
||||||
struct timerel remaining;
|
struct timerel remaining;
|
||||||
u32 blockheight;
|
u32 blockheight = p->start_block;
|
||||||
int failcode;
|
int failcode;
|
||||||
const u8 *raw_message;
|
const u8 *raw_message;
|
||||||
if (p->step != PAYMENT_STEP_FAILED)
|
if (p->step != PAYMENT_STEP_FAILED)
|
||||||
@ -1990,7 +1990,7 @@ static void waitblockheight_cb(void *d, struct payment *p)
|
|||||||
raw_message = p->result->raw_message;
|
raw_message = p->result->raw_message;
|
||||||
remaining = time_between(p->deadline, now);
|
remaining = time_between(p->deadline, now);
|
||||||
|
|
||||||
if (failcode != 17 /* Former final_expiry_too_soon */) {
|
if (failcode == 17 /* Former final_expiry_too_soon */) {
|
||||||
blockheight = p->start_block + 1;
|
blockheight = p->start_block + 1;
|
||||||
} else {
|
} else {
|
||||||
/* If it's incorrect_or_unknown_payment_details, that tells us
|
/* If it's incorrect_or_unknown_payment_details, that tells us
|
||||||
@ -2006,7 +2006,7 @@ static void waitblockheight_cb(void *d, struct payment *p)
|
|||||||
* waiting, and it is likely just some other error. Notice that
|
* waiting, and it is likely just some other error. Notice that
|
||||||
* start_block gets set by the initial getinfo call for each
|
* start_block gets set by the initial getinfo call for each
|
||||||
* attempt.*/
|
* attempt.*/
|
||||||
if (blockheight < p->start_block)
|
if (blockheight <= p->start_block)
|
||||||
return payment_continue(p);
|
return payment_continue(p);
|
||||||
|
|
||||||
plugin_log(p->plugin, LOG_INFORM,
|
plugin_log(p->plugin, LOG_INFORM,
|
||||||
|
Loading…
Reference in New Issue
Block a user