mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
pay: work around bug #1212 for existing databases.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
1b9791f0f5
commit
4ffd5e213b
@ -431,6 +431,17 @@ void payment_failed(struct lightningd *ld, const struct htlc_out *hout,
|
||||
&hout->payment_hash);
|
||||
|
||||
#ifdef COMPAT_V052
|
||||
/* Prior to "pay: delete HTLC when we delete payment." we would
|
||||
* delete a payment on retry, but leave the HTLC. */
|
||||
if (!payment) {
|
||||
log_unusual(hout->key.channel->log,
|
||||
"No payment for %s:"
|
||||
" was this an old database?",
|
||||
type_to_string(tmpctx, struct sha256,
|
||||
&hout->payment_hash));
|
||||
return;
|
||||
}
|
||||
|
||||
/* FIXME: Prior to 299b280f7, we didn't put route_nodes and
|
||||
* route_channels in db. If this happens, it's an old payment,
|
||||
* so we can simply mark it failed in db and return. */
|
||||
|
Loading…
Reference in New Issue
Block a user