-
Notifications
You must be signed in to change notification settings - Fork 993
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
Cleanup unconfirmed coinbase outputs from wallet #275
Comments
Ah that's where they are coming from - you see them for coinbase outputs if you restart the mining node (the old one sticks around in Unconfirmed). For regular txs that end up never being confirmed (for whatever reason) - am I right in thinking these keys are at risk of "replay" if they ever get reused? The tx may not have been confirmed but the recipient may have seen the input. |
That sounds correct. Maybe we could just remove them and have the wallet keep some index of the latest keys (so always strictly increment)? |
Yeah - I think keeping an incrementing counter/index in |
Current key_derivation_cache might need to go through big amounts of keys. If this happens also outside of wallet recovery, how about storing both key_id and iteration value And then the highest |
@ignopeverell I think you've addressed this in recent wallet work? |
Sorry missed the question but I believe I did, where part of the output update process removes older unconfirmed outputs (I think a day old). |
Should we close it? |
After some time mining with other nodes, we end up with some unconfirmed coinbase outputs in wallet.dat that linger there forever. They're very likely from orphaned blocks coinbase outputs. I think we could clean those up after a safe number of blocks.
Generally, we may also want to clean up unconfirmed outputs that have been stayed so for a while. Maybe after a few hundred blocks for coinbase outputs (only scenario here is orphaned blocks) and a few thousands for regular outputs (bad relay, blocks full, too low fee, etc).
The text was updated successfully, but these errors were encountered: