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

Handle desynced wallet; unknown confirmed spending tx #39

Open
cygnet3 opened this issue Sep 2, 2024 · 0 comments
Open

Handle desynced wallet; unknown confirmed spending tx #39

cygnet3 opened this issue Sep 2, 2024 · 0 comments

Comments

@cygnet3
Copy link
Owner

cygnet3 commented Sep 2, 2024

Right now we error when the user detects an input has been spent, but we cannot find the recorded 'spending transaction' (probably because that input has been spent by the other wallet). I was thinking to just change this to a warning, since it's kinda extreme to crash immediately when this happens. but this leaves the question about what to do with the transaction history.

1: the simplest option is to not do anything. we mark the inputs as 'spent' and don't show anything in the tx history. however, this has the issue that this will look weird in the tx history page. you will see a bunch of incoming txs, and no outgoing txs, but your balance is still quite low. i think that can cause a lot of questions for noobies.

2: a sophisticated option is to 'guess' the recorded outgoing transaction. we lookup all the inputs and outputs, we mark all the inputs as spent. the big issue with this is that we would need to look up the transaction from some source, so that creates a privacy concern.

3: we record a very simple 'dummy' outgoing transaction for every input spent. blindbit only tells you about the spent inputs on a block-level, so we could make the guess that every input from the block is spent in the same transaction, and group them all as a single outgoing tx (with unknown txid). maybe mark those differently from a regular outgoing transaction.

4: a last option would be to instead change the previously made incoming transactions, and remove the affected outpoints. so instead of adding an extra outgoing tx, we remove some incoming txs.

Related PR for sp-client: cygnet3/sp-client#43

@cygnet3 cygnet3 changed the title Handle unknown confirmed spending tx Handle desynced wallet; unknown confirmed spending tx Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant