diff options
| author | fanquake <[email protected]> | 2019-09-26 16:48:47 +0800 |
|---|---|---|
| committer | fanquake <[email protected]> | 2019-09-26 17:07:20 +0800 |
| commit | fdfaeb67de3694b436656f57ff65f1dc94b893f0 (patch) | |
| tree | e3dda615c9f896433a8a7630a18022bfa77d1235 /src/validation.cpp | |
| parent | Merge #16961: test: Remove python dead code linter (diff) | |
| parent | validation: Make GetWitnessCommitmentIndex public (diff) | |
| download | discoin-fdfaeb67de3694b436656f57ff65f1dc94b893f0.tar.xz discoin-fdfaeb67de3694b436656f57ff65f1dc94b893f0.zip | |
Merge #16956: validation: Make GetWitnessCommitmentIndex public
fa607c229295e0f0b89d5177b94d3381ab5e37d8 validation: Make GetWitnessCommitmentIndex public (MarcoFalke)
Pull request description:
`GenerateCoinbaseCommitment` is public and can be used in unit tests to update the witness commitment after the list of txs in a block has been changed. However, for it to work, the existing commitment (added by default in `CreateNewBlock`) must be removed (and thus its index must be known).
Make that possible by exposing the `GetWitnessCommitmentIndex` helper function in the header.
ACKs for top commit:
jb55:
ACK fa607c229295e0f0b89d5177b94d3381ab5e37d8
jamesob:
ACK https://github.com/bitcoin/bitcoin/pull/16956/commits/fa607c229295e0f0b89d5177b94d3381ab5e37d8
promag:
ACK fa607c229295e0f0b89d5177b94d3381ab5e37d8.
fanquake:
ACK fa607c229295e0f0b89d5177b94d3381ab5e37d8 - This unblocks work in #15845.
Tree-SHA512: d563aa2c201d5fb4874e506a28f468c37e457cc8a20229c377178af08c22d3be44e19ee6e8e524b6de99236cd5f2c9e39b8009d88c26854aa774737912bd5889
Diffstat (limited to 'src/validation.cpp')
| -rw-r--r-- | src/validation.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 4caee5242..1e7b9c7e6 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -3280,9 +3280,7 @@ bool IsWitnessEnabled(const CBlockIndex* pindexPrev, const Consensus::Params& pa return (height >= params.SegwitHeight); } -// Compute at which vout of the block's coinbase transaction the witness -// commitment occurs, or -1 if not found. -static int GetWitnessCommitmentIndex(const CBlock& block) +int GetWitnessCommitmentIndex(const CBlock& block) { int commitpos = -1; if (!block.vtx.empty()) { |