mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
onchain: handle case where multiple HTLCs exist for same payment_hash.
We will have probably failed the others, but either way, don't try to fulfill an HTLC we've already failed. Fixes: #394 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
55d962046b
commit
8f7a19d1a3
@@ -709,6 +709,11 @@ void onchain_fulfilled_htlc(struct channel *channel,
|
|||||||
if (hout->key.channel != channel)
|
if (hout->key.channel != channel)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* It's possible that we failed some and succeeded one,
|
||||||
|
* if we got multiple errors. */
|
||||||
|
if (hout->failcode != 0 || hout->failuremsg)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (!structeq(&hout->payment_hash, &payment_hash))
|
if (!structeq(&hout->payment_hash, &payment_hash))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user