Skip to content
This repository was archived by the owner on Feb 9, 2026. It is now read-only.

feat(lightning): Implement Reorg Checks#133

Merged
Jasonvdb merged 1 commit intomasterfrom
ldk-reorg-checks
Jun 13, 2023
Merged

feat(lightning): Implement Reorg Checks#133
Jasonvdb merged 1 commit intomasterfrom
ldk-reorg-checks

Conversation

@coreyphillips
Copy link
Copy Markdown
Collaborator

@coreyphillips coreyphillips commented Jun 12, 2023

This PR:

  • Implements reorg checks where needed.
  • Sets tx as unconfirmed when a reorg or missing tx is detected.
  • Adds unconfirmedTxs to lightning-manager.ts.
  • Removes confirmedTxs from lightning-manager.ts along with its corresponding checks.
  • Removes leftover payWithRoute methods.
  • Bumps version to 0.0.98.

When a watch transaction or watch output is seen as having one or more confirmation it is added to the unconfirmedTxs array. These txs will continue to be monitored until they reach 6 or more confirmations. If at any point a transaction is reorg'd by having a lower height than the previous known height or is no longer in the chain/mempool ldk.setTxUnconfirmed is called. In these rare scenarios, LDK will force-close and the user will have to wait roughly 143-150 blocks for their funds to be returned.

Implements reorg checks where needed.
Sets tx as unconfirmed when a reorg or missing tx is detected.
Adds unconfirmedTxs to lightning-manager.ts.
Removes confirmedTxs from lightning-manager.ts.
Removes leftover payWithRoute methods.
Bumps version to 0.0.98.
@coreyphillips coreyphillips requested a review from Jasonvdb June 12, 2023 18:26
@Jasonvdb Jasonvdb merged commit c11744a into master Jun 13, 2023
@Jasonvdb Jasonvdb deleted the ldk-reorg-checks branch June 13, 2023 18:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants