diff --git a/plugins/libplugin-pay.c b/plugins/libplugin-pay.c index 21b4ed565..22adf457d 100644 --- a/plugins/libplugin-pay.c +++ b/plugins/libplugin-pay.c @@ -118,6 +118,7 @@ struct payment *payment_new(tal_t *ctx, struct command *cmd, p->invstring = parent->invstring; p->description = parent->description; p->mods = parent->mods; + p->chainlag = parent->chainlag; } else { assert(cmd != NULL); p->partid = 0; @@ -132,6 +133,7 @@ struct payment *payment_new(tal_t *ctx, struct command *cmd, p->local_invreq_id = NULL; p->groupid = 0; p->mods = NULL; + p->chainlag = 0; } /* Initialize all modifier data so we can point to the fields when diff --git a/plugins/libplugin-pay.h b/plugins/libplugin-pay.h index 7fdf3d605..7046f9573 100644 --- a/plugins/libplugin-pay.h +++ b/plugins/libplugin-pay.h @@ -326,6 +326,11 @@ struct payment { * explanation if a payment is aborted. */ char *aborterror; + /* How many blocks are we lagging behind the rest of the + network? This needs to be taken into consideration when + sending payments before being fully caught up.*/ + u32 chainlag; + /* Callback to be called when the entire payment process * completes successfully. */ void (*on_payment_success)(struct payment *p);