@@ -220,11 +220,12 @@ static u32 *shadow_additions(const tal_t *ctx,
220220 shadow_delay = shadow_one_flow (gossmap , flows [i ],
221221 & shadow_fee );
222222 if (flow_delay (flows [i ]) + shadow_delay > p -> maxdelay ) {
223- debug_paynote (p , "No shadow for flow %zu/%zu:"
224- " delay would add %u to %" PRIu64 ", exceeding max delay." ,
225- i , tal_count (flows ),
226- shadow_delay ,
227- flow_delay (flows [i ]));
223+ payment_note (p , LOG_UNUSUAL ,
224+ "No shadow for flow %zu/%zu:"
225+ " delay would add %u to %" PRIu64 ", exceeding max delay." ,
226+ i , tal_count (flows ),
227+ shadow_delay ,
228+ flow_delay (flows [i ]));
228229 continue ;
229230 }
230231
@@ -235,7 +236,8 @@ static u32 *shadow_additions(const tal_t *ctx,
235236 if (is_entire_payment && tal_count (flows ) == 1 ) {
236237 if (!add_to_amounts (gossmap , flows [i ], p -> maxspend ,
237238 shadow_fee )) {
238- debug_paynote (p , "No shadow fee for flow %zu/%zu:"
239+ payment_note (p , LOG_UNUSUAL ,
240+ "No shadow fee for flow %zu/%zu:"
239241 " fee would add %s to %s, exceeding budget %s." ,
240242 i , tal_count (flows ),
241243 type_to_string (tmpctx , struct amount_msat ,
@@ -245,7 +247,8 @@ static u32 *shadow_additions(const tal_t *ctx,
245247 type_to_string (tmpctx , struct amount_msat ,
246248 & p -> maxspend ));
247249 } else {
248- debug_paynote (p , "No MPP, so added %s shadow fee" ,
250+ payment_note (p , LOG_DBG ,
251+ "No MPP, so added %s shadow fee" ,
249252 type_to_string (tmpctx , struct amount_msat ,
250253 & shadow_fee ));
251254 }
@@ -444,13 +447,11 @@ const char *add_payflows(const tal_t *ctx,
444447 disabled = make_disabled_bitmap (tmpctx , pay_plugin -> gossmap , p -> disabled_scids );
445448 src = gossmap_find_node (pay_plugin -> gossmap , & pay_plugin -> my_id );
446449 if (!src ) {
447- debug_paynote (p , "We don't have any channels?" );
448450 * ecode = PAY_ROUTE_NOT_FOUND ;
449451 return tal_fmt (ctx , "We don't have any channels." );
450452 }
451453 dst = gossmap_find_node (pay_plugin -> gossmap , & p -> destination );
452454 if (!dst ) {
453- debug_paynote (p , "No trace of destination in network gossip" );
454455 * ecode = PAY_ROUTE_NOT_FOUND ;
455456 return tal_fmt (ctx , "Destination is unknown in the network gossip." );
456457 }
@@ -472,10 +473,6 @@ const char *add_payflows(const tal_t *ctx,
472473 p -> base_fee_penalty ,
473474 p -> prob_cost_factor );
474475 if (!flows ) {
475- debug_paynote (p ,
476- "minflow couldn't find a feasible flow for %s" ,
477- type_to_string (tmpctx ,struct amount_msat ,& amount ));
478-
479476 * ecode = PAY_ROUTE_NOT_FOUND ;
480477 return tal_fmt (ctx ,
481478 "minflow couldn't find a feasible flow for %s" ,
@@ -487,7 +484,7 @@ const char *add_payflows(const tal_t *ctx,
487484 fee = flow_set_fee (flows );
488485 delay = flows_worst_delay (flows ) + p -> final_cltv ;
489486
490- debug_paynote ( p ,
487+ payment_note ( p , LOG_INFORM ,
491488 "we have computed a set of %ld flows with probability %.3lf, fees %s and delay %ld" ,
492489 tal_count (flows ),
493490 prob ,
@@ -497,9 +494,6 @@ const char *add_payflows(const tal_t *ctx,
497494 too_expensive = amount_msat_greater (fee , feebudget );
498495 if (too_expensive )
499496 {
500- debug_paynote (p , "Flows too expensive, fee = %s (max %s)" ,
501- type_to_string (tmpctx , struct amount_msat , & fee ),
502- type_to_string (tmpctx , struct amount_msat , & feebudget ));
503497 * ecode = PAY_ROUTE_TOO_EXPENSIVE ;
504498 return tal_fmt (ctx ,
505499 "Fee exceeds our fee budget, "
@@ -509,12 +503,8 @@ const char *add_payflows(const tal_t *ctx,
509503 }
510504 too_delayed = (delay > p -> maxdelay );
511505 if (too_delayed ) {
512- debug_paynote (p , "Flows too delayed, delay = %" PRIu64 " (max %u)" ,
513- delay , p -> maxdelay );
514-
515506 /* FIXME: What is a sane limit? */
516507 if (p -> delay_feefactor > 1000 ) {
517- debug_paynote (p , "Giving up!" );
518508 * ecode = PAY_ROUTE_TOO_EXPENSIVE ;
519509 return tal_fmt (ctx ,
520510 "CLTV delay exceeds our CLTV budget, "
@@ -523,8 +513,10 @@ const char *add_payflows(const tal_t *ctx,
523513 }
524514
525515 p -> delay_feefactor *= 2 ;
526- debug_paynote (p , "Doubling delay_feefactor to %f" ,
527- p -> delay_feefactor );
516+ payment_note (p , LOG_INFORM ,
517+ "delay %" PRIu64 " exceeds our max %u, so doubling delay_feefactor to %f" ,
518+ delay , p -> maxdelay ,
519+ p -> delay_feefactor );
528520
529521 continue ; // retry
530522 }
0 commit comments