-
Notifications
You must be signed in to change notification settings - Fork 267
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
Electrum fixes #873
Electrum fixes #873
Conversation
sstone
commented
Feb 18, 2019
- clear history status when we get disconnected and still have pending history requests
- represent block heights as signed integers
- prepend a version number to persisted electrum wallet data
…g history transactions When we get disconnected and have script hashes for which we still have pending connections, clear the script hash status. When we reconnect we will ask for its history again, this way we won't miss anything. Since we rotate keys it should not result in heavy traffic (script hashes have few history items).
Int.MaxValue is about 40,000 years of block which should be enough, and it will fix the encoding problem users on testnet when there's a reorg and one of their txs has a height of -1. Side-note: changing the wallet codec can be done easily: if we cannot read and decode persisted data we just start with an empty wallet and retrieve all wallet data from electrum servers, and once it's ready it will be encoded with the new codec and saved.
It provides a clean way, when upgrading the app, of choosing whether to keep the same version and start from the last persisted wallet (if the persistence format has not been changed or is compatible with the old one), or to change the version and force starting from an empty wallet and downloading all wallet items from Electrum servers.
downloadHeadersIfMissing(height.toInt) | ||
client ! GetMerkle(txid, height.toInt) | ||
case (Some(previousHeight), height) if previousHeight == height && data.proofs.get(txid).isEmpty => | ||
if (height > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why isn't this check in the downloadHeadersIfMissing
function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because you don't want to download headers, but you also don't want to download merkle proofs.