validation: Make GetWitnessCommitmentIndex public

This commit is contained in:
MarcoFalke 2019-09-24 11:18:17 -04:00
parent 3ce8298888
commit fa607c2292
No known key found for this signature in database
GPG key ID: CE2B75697E69A548
2 changed files with 4 additions and 3 deletions

View file

@ -3280,9 +3280,7 @@ bool IsWitnessEnabled(const CBlockIndex* pindexPrev, const Consensus::Params& pa
return (height >= params.SegwitHeight); return (height >= params.SegwitHeight);
} }
// Compute at which vout of the block's coinbase transaction the witness int GetWitnessCommitmentIndex(const CBlock& block)
// commitment occurs, or -1 if not found.
static int GetWitnessCommitmentIndex(const CBlock& block)
{ {
int commitpos = -1; int commitpos = -1;
if (!block.vtx.empty()) { if (!block.vtx.empty()) {

View file

@ -384,6 +384,9 @@ bool IsWitnessEnabled(const CBlockIndex* pindexPrev, const Consensus::Params& pa
/** When there are blocks in the active chain with missing data, rewind the chainstate and remove them from the block index */ /** When there are blocks in the active chain with missing data, rewind the chainstate and remove them from the block index */
bool RewindBlockIndex(const CChainParams& params) LOCKS_EXCLUDED(cs_main); bool RewindBlockIndex(const CChainParams& params) LOCKS_EXCLUDED(cs_main);
/** Compute at which vout of the block's coinbase transaction the witness commitment occurs, or -1 if not found */
int GetWitnessCommitmentIndex(const CBlock& block);
/** Update uncommitted block structures (currently: only the witness reserved value). This is safe for submitted blocks. */ /** Update uncommitted block structures (currently: only the witness reserved value). This is safe for submitted blocks. */
void UpdateUncommittedBlockStructures(CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams); void UpdateUncommittedBlockStructures(CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams);