HomePhabricator

[backport#13657] wallet: assert to ensure accuracy of CMerkleTx…

Description

[backport#13657] wallet: assert to ensure accuracy of CMerkleTx::GetBlocksToMaturity

Summary:
93de2891fa9cb8314573ba3a6ab764bc9c52444d wallet: assert to ensure accuracy of CMerkleTx::GetBlocksToMaturity (Ben Woosley)

Pull request description:

According to my understanding, it should not be possible for coinbase
transactions to be conflicting, thus it should not be possible for
GetDepthInMainChain to return a negative result. If it did, this would
also result in innacurate results for GetBlocksToMaturity due to the
math therein. asserting ensures accuracy.

https://github.com/bitcoin/bitcoin/pull/13657/commits/93de2891fa9cb8314573ba3a6ab764bc9c52444d


Backport of Core PR13657

Test Plan:

ninja check check-functional

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D7026

Details

Provenance
Wladimir J. van der Laan <laanwj@gmail.com>Authored on Aug 7 2018, 12:09
majcostaCommitted on Jul 24 2020, 13:34
majcostaPushed on Jul 24 2020, 13:34
Reviewer
Restricted Project
Differential Revision
D7026: [backport#13657] wallet: assert to ensure accuracy of CMerkleTx::GetBlocksToMaturity
Parents
rABCaab16958ccd8: [backport#16502] wallet: Drop unused OldKey
Branches
Unknown
Tags
Unknown