mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-20 10:39:49 +01:00
renepay: wake-up result collector every 50msec
This commit is contained in:
parent
014e32ca2f
commit
985a01b41d
@ -19,6 +19,8 @@
|
|||||||
#define OP_CALL (void *)1
|
#define OP_CALL (void *)1
|
||||||
#define OP_IF (void *)2
|
#define OP_IF (void *)2
|
||||||
|
|
||||||
|
#define COLLECTOR_TIME_WINDOW_MSEC 50
|
||||||
|
|
||||||
void *payment_virtual_program[];
|
void *payment_virtual_program[];
|
||||||
|
|
||||||
/* Advance the payment virtual machine */
|
/* Advance the payment virtual machine */
|
||||||
@ -863,11 +865,9 @@ static void sleep_done(struct payment *payment)
|
|||||||
|
|
||||||
static struct command_result *sleep_cb(struct payment *payment)
|
static struct command_result *sleep_cb(struct payment *payment)
|
||||||
{
|
{
|
||||||
// FIXME time duration is hardcoded, we could have this as a
|
|
||||||
// plugin wide option with default value at 10 millisecons.
|
|
||||||
assert(payment->waitresult_timer == NULL);
|
assert(payment->waitresult_timer == NULL);
|
||||||
payment->waitresult_timer = plugin_timer(
|
payment->waitresult_timer = plugin_timer(
|
||||||
pay_plugin->plugin, time_from_msec(10), sleep_done, payment);
|
pay_plugin->plugin, time_from_msec(COLLECTOR_TIME_WINDOW_MSEC), sleep_done, payment);
|
||||||
struct command *cmd = payment_command(payment);
|
struct command *cmd = payment_command(payment);
|
||||||
assert(cmd);
|
assert(cmd);
|
||||||
return command_still_pending(cmd);
|
return command_still_pending(cmd);
|
||||||
|
Loading…
Reference in New Issue
Block a user