diff --git a/plugins/xpay/xpay.c b/plugins/xpay/xpay.c index febc1c1e60..2bc4c36e96 100644 --- a/plugins/xpay/xpay.c +++ b/plugins/xpay/xpay.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -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;