forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 724
[Bug] Fix GetDepthInMainChain returning 0 when tx is not in mempool #1040
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
Merged
random-zebra
merged 1 commit into
PIVX-Project:master
from
random-zebra:2019_bug_coinstakes_mempool
Oct 12, 2019
Merged
[Bug] Fix GetDepthInMainChain returning 0 when tx is not in mempool #1040
random-zebra
merged 1 commit into
PIVX-Project:master
from
random-zebra:2019_bug_coinstakes_mempool
Oct 12, 2019
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80374cd to
2d04b22
Compare
9b995d2 to
8555df6
Compare
8555df6 to
29641e3
Compare
Fuzzbawls
approved these changes
Oct 12, 2019
Collaborator
Fuzzbawls
left a comment
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.
utACK 29641e3
furszy
approved these changes
Oct 12, 2019
furszy
left a comment
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.
utACK 29641e3
random-zebra
added a commit
that referenced
this pull request
Oct 12, 2019
… in mempool 29641e3 [Wallet] Fix inconsistencies with GetDepthInMainChain (random-zebra) Pull request description: Fix a few inconsistencies with `GetDepthInMainChain` returning 0 where a value -1 was expected (for orphans) and a bug where nodes may relay coinstake transactions. ACKs for top commit: Fuzzbawls: utACK 29641e3 furszy: utACK 29641e3 Tree-SHA512: db57b7e9dfd837932b09eae1697ce53e45c3da859ae15cde52234eafe826f15f8bdb75aadb9150fc19ed34a9a5b86cf68d1d26874b488d8d2e13a2300f3e35cb
random-zebra
added a commit
that referenced
this pull request
Oct 18, 2019
…uts to the wallet 3a7ec7c [Tests] Add wallet_reorg-stake functional test to test_runner.py (random-zebra) a0285e4 [Wallet] Fix bug with coinstake inputs wrongly marked as spent (random-zebra) bb683c7 [Tests] Add wallet_reorg-stake functional test (random-zebra) 3eca8da [Core][Tests] REGTEST: fix nStakeModifier=0 (random-zebra) Pull request description: Additional bug introduced with the changes of #970 (and not caught in #1040 even though the culprit is the same: `GetDepthInMainChain` returning a value `0` when `-1` was expected). After a block reorganization, the coins used as coinstake inputs in the orphan chain were still marked as spent in the wallet. Thus there were inconsistencies in the balance (either displayed in the GUI or returned by `getbalance` via CLI) and missing utxos in the wallet (either accessed through coincontrol in the GUI or returned by `listunspent` via CLI). a0285e4 fixes it by marking as "spent" the inputs of not-in-mempool txes only for non-coinstakes (coinstakes don't hit the mempool so, when not in chain, their inputs should be considered unspent). bb683c7 Introduces the functional test `wallet_reorg-stake` to reproduce the issue. The test fails without a0285e4 and passes with it. ACKs for top commit: Warrows: ACK 3a7ec7c Tree-SHA512: 8f97e3d48720b776c84820e0ab8257665ac4c4c9d394db0e4b9f3a05b0904bf9f70cf54865338c4e29066e6b3670e9e90f77780d3ddd198e8e2b6e416c4cb49c
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix a few inconsistencies with
GetDepthInMainChainreturning 0 where a value -1 was expected (for orphans) and a bug where nodes may relay coinstake transactions.