Send tip change notification from invalidateblock #9196

Merged
merged 1 commit into from Nov 23, 2016

Projects

None yet

8 participants

@ryanofsky
Contributor

@MarcoFalke suggested separating this commit from #9139. It's needed to prevent breaking a test that would otherwise fail with #9139.

@ryanofsky @ryanofsky ryanofsky Send tip change notification from invalidateblock
This change is needed to prevent sync_blocks timeouts in the mempool_reorg
test after the sync_blocks update in the upcoming commit
"[qa] Change sync_blocks to pick smarter maxheight".

This change was initially suggested by Suhas Daftuar <sdaftuar@chaincode.com>
in bitcoin#8680 (comment)
67c6326
@morcos
Contributor
morcos commented Nov 21, 2016

ACK

@MarcoFalke
Member
MarcoFalke commented Nov 21, 2016 edited

Concept ACK.

Can confirm, that this fixes the "Current number of blocks" display in the debug window, when invalidateblock is used.

Also, can confirm that this fixes the test failure in mempool_reorg after #9139.

@MarcoFalke MarcoFalke added this to the 0.13.2 milestone Nov 21, 2016
@MarcoFalke
Member
MarcoFalke commented Nov 21, 2016 edited

Tagged for backport to .13

(Backport to .12 also required)

@MarcoFalke MarcoFalke modified the milestone: 0.12.2, 0.13.2 Nov 21, 2016
@sipa
Member
sipa commented Nov 22, 2016

utACK

@sdaftuar
Contributor

utACK

@jonasschnelli
Member

utACK 67c6326

@laanwj laanwj merged commit 67c6326 into bitcoin:master Nov 23, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@laanwj laanwj added a commit that referenced this pull request Nov 23, 2016
@laanwj laanwj Merge #9196: Send tip change notification from invalidateblock
67c6326 Send tip change notification from invalidateblock (Russell Yanofsky)
7e2bfd6
@@ -3201,6 +3201,7 @@ bool InvalidateBlock(CValidationState& state, const CChainParams& chainparams, C
InvalidChainFound(pindex);
mempool.removeForReorg(pcoinsTip, chainActive.Tip()->nHeight + 1, STANDARD_LOCKTIME_VERIFY_FLAGS);
+ uiInterface.NotifyBlockTip(IsInitialBlockDownload(), pindex->pprev);
@luke-jr
luke-jr Nov 23, 2016 Member

What if the new best isn't pindex->pprev?

@jonasschnelli
jonasschnelli Nov 23, 2016 Member

At this point, pindex->pprev == chainActive.Tip().
If there are valid blocks on top of the new tip with more ChainWork, it will be detected during the ActivateBestChain(state, Params(), NULL); in UniValue invalidateblock(const JSONRPCRequest& request).
The signal then gets fired twice (seems to be okay).

@MarcoFalke MarcoFalke added a commit that referenced this pull request Nov 23, 2016
@MarcoFalke MarcoFalke Merge #9139: Change sync_blocks to pick smarter maxheight (on top of #…
…9196)


1126c85 [qa] Change sync_blocks to pick smarter maxheight (Russell Yanofsky)
0de7fd3
@MarcoFalke MarcoFalke added a commit to MarcoFalke/bitcoin that referenced this pull request Nov 23, 2016
@ryanofsky @MarcoFalke ryanofsky + MarcoFalke Send tip change notification from invalidateblock
This change is needed to prevent sync_blocks timeouts in the mempool_reorg
test after the sync_blocks update in the upcoming commit
"[qa] Change sync_blocks to pick smarter maxheight".

This change was initially suggested by Suhas Daftuar <sdaftuar@chaincode.com>
in bitcoin#8680 (comment)

Github-Pull: #9196
Rebased-From: 67c6326
d0d5065
@MarcoFalke MarcoFalke added a commit to MarcoFalke/bitcoin that referenced this pull request Nov 23, 2016
@ryanofsky @MarcoFalke ryanofsky + MarcoFalke Send tip change notification from invalidateblock
This change is needed to prevent sync_blocks timeouts in the mempool_reorg
test after the sync_blocks update in the upcoming commit
"[qa] Change sync_blocks to pick smarter maxheight".

This change was initially suggested by Suhas Daftuar <sdaftuar@chaincode.com>
in bitcoin#8680 (comment)

Github-Pull: #9196
Rebased-From: 67c6326
cca151b
@MarcoFalke MarcoFalke modified the milestone: 0.12.2, 0.13.2 Nov 23, 2016
@luke-jr luke-jr added a commit to luke-jr/bitcoin that referenced this pull request Dec 2, 2016
@ryanofsky @luke-jr ryanofsky + luke-jr Send tip change notification from invalidateblock
This change is needed to prevent sync_blocks timeouts in the mempool_reorg
test after the sync_blocks update in the upcoming commit
"[qa] Change sync_blocks to pick smarter maxheight".

This change was initially suggested by Suhas Daftuar <sdaftuar@chaincode.com>
in bitcoin#8680 (comment)

Github-Pull: #9196
Rebased-From: 67c6326
0c09d9f
@laanwj laanwj added the Validation label Dec 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment