mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-15 11:59:16 +01:00
pay: Do not delete old sendpay attempts if we retry
This was the main cause of the pay states flip-flopping, since we reset the status on each attempt any final status is not really final. Let's keep them around, and provide a stable history.
This commit is contained in:
parent
a4fb5bceb0
commit
39248b5fa7
1 changed files with 4 additions and 5 deletions
|
@ -1033,13 +1033,12 @@ send_payment_core(struct lightningd *ld,
|
|||
"First peer not ready"));
|
||||
}
|
||||
|
||||
/* If we're retrying, delete all trace of previous one. We delete
|
||||
* outgoing HTLC, too, otherwise it gets reported to onchaind as
|
||||
* a possibility, and we end up in handle_missing_htlc_output->
|
||||
* onchain_failed_our_htlc->payment_failed with no payment.
|
||||
/* If we're retrying we delete outgoing HTLC otherwise it gets
|
||||
* reported to onchaind as a possibility, and we end up in
|
||||
* handle_missing_htlc_output -> onchain_failed_our_htlc ->
|
||||
* payment_failed with no payment.
|
||||
*/
|
||||
if (old_payment) {
|
||||
wallet_payment_delete(ld->wallet, rhash, partid);
|
||||
wallet_local_htlc_out_delete(ld->wallet, channel, rhash,
|
||||
partid);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue