lightningd: remove log_add functions.

They added complexity, and were only used in a few places.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-11-18 10:57:17 +10:30
parent a83fd16840
commit 39d537b495
4 changed files with 12 additions and 49 deletions

View File

@@ -690,13 +690,12 @@ send_payment(struct lightningd *ld,
payment = wallet_payment_by_hash(tmpctx, ld->wallet, rhash);
if (payment) {
/* FIXME: We should really do something smarter here! */
log_debug(ld->log, "send_payment: found previous");
if (payment->status == PAYMENT_PENDING) {
log_add(ld->log, "Payment is still in progress");
log_debug(ld->log, "send_payment: previous still in progress");
return json_sendpay_in_progress(cmd, payment);
}
if (payment->status == PAYMENT_COMPLETE) {
log_add(ld->log, "... succeeded");
log_debug(ld->log, "send_payment: previous succeeded");
/* Must match successful payment parameters. */
if (!amount_msat_eq(payment->msatoshi, msat)) {
return command_fail(cmd, PAY_RHASH_ALREADY_USED,
@@ -715,7 +714,7 @@ send_payment(struct lightningd *ld,
}
return sendpay_success(cmd, payment);
}
log_add(ld->log, "... retrying");
log_debug(ld->log, "send_payment: found previous, retrying");
}
channel = active_channel_by_id(ld, &ids[0], NULL);