mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 09:04:22 +01:00
paymod: Do not wait for a blockheight if we're already there
We want to differentiate a wrong block-height from other failure reasons, such as an unknown `payment_hash`, so we skip the `waitblockheight` if we're already at the correct height.
This commit is contained in:
@@ -1990,6 +1990,13 @@ static void waitblockheight_cb(void *d, struct payment *p)
|
|||||||
return payment_continue(p);
|
return payment_continue(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If we are already at the desired blockheight there is no point in
|
||||||
|
* waiting, and it is likely just some other error. Notice that
|
||||||
|
* start_block gets set by the initial getinfo call for each
|
||||||
|
* attempt.*/
|
||||||
|
if (blockheight < p->start_block)
|
||||||
|
return payment_continue(p);
|
||||||
|
|
||||||
plugin_log(p->plugin, LOG_INFORM,
|
plugin_log(p->plugin, LOG_INFORM,
|
||||||
"Remote node appears to be on a longer chain, which causes "
|
"Remote node appears to be on a longer chain, which causes "
|
||||||
"CLTV timeouts to be incorrect. Waiting up to %" PRIu64
|
"CLTV timeouts to be incorrect. Waiting up to %" PRIu64
|
||||||
|
|||||||
Reference in New Issue
Block a user