Skip to content

Commit

Permalink
renepay: put global variables into renepayconfig.h
Browse files Browse the repository at this point in the history
Signed-off-by: Lagrang3 <[email protected]>
  • Loading branch information
Lagrang3 authored and endothermicdev committed May 23, 2024
1 parent 6b91497 commit 2664fae
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions plugins/renepay/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ PLUGIN_RENEPAY_HDRS := \
plugins/renepay/payment.h \
plugins/renepay/payment_info.h \
plugins/renepay/chan_extra.h \
plugins/renepay/renepayconfig.h \
plugins/renepay/route.h \
plugins/renepay/routebuilder.h \
plugins/renepay/routetracker.h \
Expand Down
3 changes: 1 addition & 2 deletions plugins/renepay/mods.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <plugins/renepay/mcf.h>
#include <plugins/renepay/mods.h>
#include <plugins/renepay/payplugin.h>
#include <plugins/renepay/renepayconfig.h>
#include <plugins/renepay/route.h>
#include <plugins/renepay/routebuilder.h>
#include <plugins/renepay/routetracker.h>
Expand All @@ -19,8 +20,6 @@
#define OP_CALL (void *)1
#define OP_IF (void *)2

#define COLLECTOR_TIME_WINDOW_MSEC 50

void *payment_virtual_program[];

/* Advance the payment virtual machine */
Expand Down
10 changes: 1 addition & 9 deletions plugins/renepay/payplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <plugins/libplugin.h>
#include <plugins/renepay/flow.h>
#include <plugins/renepay/payment.h>
#include <plugins/renepay/renepayconfig.h>
#include <plugins/renepay/uncertainty.h>

// TODO(eduardo): renepaystatus should be similar to paystatus
Expand All @@ -20,15 +21,6 @@
// TODO(eduardo): check if paynotes are meaningful
// TODO(eduardo): remove assertions, introduce LOG_BROKEN messages

#define MAX_NUM_ATTEMPTS 10

/* Time lapse used to wait for failed sendpays before try_paying. */
#define TIMER_COLLECT_FAILURES_MSEC 250

/* Knowledge is proportionally decreased with time up to TIMER_FORGET_SEC when
* we forget everything. */
#define TIMER_FORGET_SEC 3600

// TODO(eduardo): Test ideas
// - make a payment to a node that is hidden behind private channels, check that
// private channels are removed from the gossmap and chan_extra_map
Expand Down
14 changes: 14 additions & 0 deletions plugins/renepay/renepayconfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef LIGHTNING_PLUGINS_RENEPAY_RENEPAYCONFIG_H
#define LIGHTNING_PLUGINS_RENEPAY_RENEPAYCONFIG_H
#include "config.h"

#define MAX_NUM_ATTEMPTS 10

/* Knowledge is proportionally decreased with time up to TIMER_FORGET_SEC when
* we forget everything. */
#define TIMER_FORGET_SEC 3600

/* Time lapse used to wait for failed sendpays. */
#define COLLECTOR_TIME_WINDOW_MSEC 50

#endif /* LIGHTNING_PLUGINS_RENEPAY_RENEPAYCONFIG_H */

0 comments on commit 2664fae

Please sign in to comment.