xpay: make sure we report if we ever try to call getroutes with 0msat.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2025-01-23 09:38:29 +10:30
parent 89ca5aef9f
commit 43130a33be

View file

@ -7,6 +7,7 @@
#include <ccan/tal/str/str.h>
#include <common/bolt11.h>
#include <common/bolt12.h>
#include <common/daemon.h>
#include <common/dijkstra.h>
#include <common/gossmap.h>
#include <common/gossmods_listpeerchannels.h>
@ -1138,6 +1139,12 @@ static struct command_result *getroutes_for(struct command *aux_cmd,
const struct pubkey *dst;
struct amount_msat maxfee;
/* I would normally assert here, but we have reports of this happening... */
if (amount_msat_is_zero(deliver)) {
payment_log(payment, LOG_BROKEN, "getroutes for 0msat!");
send_backtrace("getroutes for 0msat!");
}
/* If we get injectpaymentonion responses, they can wait */
payment->amount_being_routed = deliver;