cln/plugins/renepay/Makefile
Lagrang3 580c2f7854 renepay: refactor and bugfixes
We remove the auxiliary RPC renesenday (only used internally) in favor
of a function that builds the onion, stores the shared secrets
needed to recover the onion reply, and calls sendonion/injectpaymentonion.

This solves a concurrency race
```
**BROKEN** plugin-cln-renepay: Unable to parse sendpay_failure
```
in which we are waiting for renesenday to return in order to record the shared
secrets but we get the a sendpay_failure notification with an onionreply
before we have secrets to decode it.

It also solves a missing JSON id seen in the logs
```
DEBUG   plugin-cln-renepay: JSON reply with unknown id
```
because renesendpay was using his command variable to issue an RPC
to sendonion/injecpaymentonion and would fail or succeed the command
before those RPCs were done. This also meant that the callback
functions were silently being ignored.

Changelog-Fixed: renepay: fixes a race condition that leads to **BROKEN** plugin-cln-renepay: Unable to parse sendpay_failure

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
2026-02-23 14:32:56 +10:30

48 lines
1.5 KiB
Makefile

PLUGIN_RENEPAY_SRC := \
plugins/renepay/main.c \
plugins/renepay/flow.c \
plugins/renepay/mcf.c \
plugins/renepay/dijkstra.c \
plugins/renepay/disabledmap.c \
plugins/renepay/payment.c \
plugins/renepay/chan_extra.c \
plugins/renepay/route.c \
plugins/renepay/routebuilder.c \
plugins/renepay/routetracker.c \
plugins/renepay/routefail.c \
plugins/renepay/uncertainty.c \
plugins/renepay/mods.c \
plugins/renepay/errorcodes.c \
plugins/renepay/json.c
PLUGIN_RENEPAY_HDRS := \
plugins/renepay/payplugin.h \
plugins/renepay/flow.h \
plugins/renepay/mcf.h \
plugins/renepay/dijkstra.h \
plugins/renepay/disabledmap.h \
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 \
plugins/renepay/routefail.h \
plugins/renepay/uncertainty.h \
plugins/renepay/mods.h \
plugins/renepay/errorcodes.h \
plugins/renepay/json.h
PLUGIN_RENEPAY_OBJS := $(PLUGIN_RENEPAY_SRC:.c=.o)
# Make sure these depend on everything.
PLUGIN_ALL_SRC += $(PLUGIN_RENEPAY_SRC)
PLUGIN_ALL_HEADER += $(PLUGIN_RENEPAY_HDRS)
# Make all plugins depend on all plugin headers, for simplicity (and this file).
$(PLUGIN_RENEPAY_OBJS): $(PLUGIN_RENEPAY_HDRS) plugins/renepay/Makefile
plugins/cln-renepay: $(PLUGIN_RENEPAY_OBJS) $(PLUGIN_LIB_OBJS) libcommon.a
include plugins/renepay/test/Makefile