Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi: migrate forwarding_history table #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

carlaKC
Copy link
Collaborator

@carlaKC carlaKC commented May 24, 2024

Fixes #83, and while we're here updates forwarding_history to allow null ougoing_peer to allow still storing forwards in the case where we're not able to lookup peer pubkey (can happen in a few edge cases).

Update the forwarding_history table's schema to relax restrictions:
1. Allow nil outgoing peer: when we can't look up our outgoing peer,
   we currently do not persist the forward. We only hit this in some
   edge cases, so we update the schema to allow null values so that we
   can still persist the forward.
2. Allow non-unique outgoing channel/index: when we fail htlcs locally,
   the outgoing index will always be 0 in our resolution, so we need to
   restrict this constraint to be able to record local failures.

SQLite has limited alter table functionality available, so this is
achieved by creating a temporary table and migrating new values to it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mark htlc complete failed: constraint failed: UNIQUE constraint failed
1 participant