Skip to content

Commit dd514d4

Browse files
committed
xpay: make sure we report if we ever try to call getroutes with 0msat.
Signed-off-by: Rusty Russell <[email protected]>
1 parent b57b160 commit dd514d4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

plugins/xpay/xpay.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <ccan/tal/str/str.h>
88
#include <common/bolt11.h>
99
#include <common/bolt12.h>
10+
#include <common/daemon.h>
1011
#include <common/dijkstra.h>
1112
#include <common/gossmap.h>
1213
#include <common/gossmods_listpeerchannels.h>
@@ -1136,6 +1137,12 @@ static struct command_result *getroutes_for(struct command *aux_cmd,
11361137
const struct pubkey *dst;
11371138
struct amount_msat maxfee;
11381139

1140+
/* I would normally assert here, but we have reports of this happening... */
1141+
if (amount_msat_is_zero(deliver)) {
1142+
payment_log(payment, LOG_BROKEN, "getroutes for 0msat!");
1143+
send_backtrace("getroutes for 0msat!");
1144+
}
1145+
11391146
/* If we get injectpaymentonion responses, they can wait */
11401147
payment->amount_being_routed = deliver;
11411148

0 commit comments

Comments
 (0)