fix(electrum): fixed chain sync issue #1163
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This replaces #1145 and is based on this comment: #1145 (comment). I pushed forward with this as I think it is a really good idea to include this in our
alpha.2
milestone.This may or may not fix #1125 (however, neither @LagginTimes or myself can replicate the issue @danielabrozzoni has been running into - check #1145 for convo). We can confirm whether it does once we have proper tests. However, these changes here obviously fix a logical flaw.
construct_update_tip
that caused the local chain tip to always be a block behind the actual tip.construct_update_tip
logic.ASSUME_FINAL_DEPTH
is renamed toMAX_REORG_DEPTH
.Notes to the reviewers
This is tested manually (we need to add a proper test framework in the near future). I can perform the following successfully:
example_electrum scan
can detect incoming transactions when unconfirmed, and detect that is becomes confirm in later calls.exampl_electrum sync
can do that same.Changelog notice
construct_update_tip
that caused the local chain tip to always be a block behind the actual tip.Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingBugfixes:
* [ ] This pull request breaks the existing API* [ ] I've added tests to reproduce the issue which are now passing