Skip to content

checkOutput: Throw an error on old spent outputs#35

Open
Numerio wants to merge 1 commit into
HyperspaceApp:masterfrom
Numerio:heightFix
Open

checkOutput: Throw an error on old spent outputs#35
Numerio wants to merge 1 commit into
HyperspaceApp:masterfrom
Numerio:heightFix

Conversation

@Numerio

@Numerio Numerio commented Nov 19, 2018

Copy link
Copy Markdown
Contributor

Should be the adequate fix for the problem.

@huetsch

huetsch commented Nov 24, 2018

Copy link
Copy Markdown
Contributor

Having reviewed this more, here is the situation they were trying to catch. A wallet spends an output and so the output is present in the spentOutputs database. However, typically, after being spent, the transaction containing the output is confirmed and the wallet will delete the spendable output from the wallet database in updateConfirmedSet. They are trying to handle the situation where a transaction never gets confirmed but has been marked as spent, so they allow us to respend it.

A better solution is to disallow all spent outputs. When each new block comes in, the wallet should:

a) see if we have really old spent outputs that never showed up on the chain and unspend them and
b) see if anyone else spent one of our outputs (another wallet using the same seed) and if so, mark the output as spent.

Let's redesign this solution a bit instead of using an ugly hack when we're trying to spend.

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.

2 participants