ElementsProject / ElementsProject/lightning

ochaind: Track HTLC status correctly across channel closes

Open
#7,822 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
3.1k
Forks
1k
Avg merge
4d 10h
Merged PRs (30d)
13

Description

### Issue and Steps to Reproduce

This is a phenomenon we have observed a couple of times in Greenlight:

1. We initiate a payment
2. The payment has some HTLC that times out (likely due to the signer
not being present, but getting stuck downstream is also a common
cause)
3. The channel then closes because it hits the HTLC deadline
4. The HTLC outputs get resolved / swept correctly, but the HTLC
still shows up as pending, and will never be resolved.

The HTLC should instead be marked as either `complete` or `timeout`
when `onchaind` reports the HTLC output being swept to `lightningd`
and `lightningd` ought to store this in the DB as well.

### `getinfo` output

```javascript
{
"id": "03442386091363708e6e3bcda4dd978d7777743fde7a4990166cdec2e5065149f1",
"alias": "BLUESEAGULL-v24.02gl1",
"color": "034423",
"num_peers": 1,
"num_active_channels": 1,
"version": "v24.02gl1",
"lightning_dir": "/tmp/bitcoin",
"our_features": {
"init": "08a0800a8a59a1",
"node": "88a0800a8a59a1",
"invoice": "02000002024100",
"channel": ""
},
"blockheight": 870397,
"network": "bitcoin",
"fees_collected_msat": {
"msat": 0
},
"warning_lightningd_sync": "Still loading latest blocks from bitcoind."
}
```

Ignore the sync warning, it is a peculiarity of how we set up
Greenlight's bitcoin backends.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.