| 4894 | } |
| 4895 | |
| 4896 | void UpdateUncommittedBlockStructures(CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams) |
| 4897 | { |
| 4898 | int commitpos = GetWitnessCommitmentIndex(block); |
| 4899 | static const std::vector<unsigned char> nonce(32, 0x00); |
| 4900 | if (commitpos != -1 && IsWitnessEnabled(pindexPrev, consensusParams) && block.vtx[0].wit.IsEmpty()) { |
| 4901 | block.vtx[0].wit.vtxinwit.resize(1); |
| 4902 | block.vtx[0].wit.vtxinwit[0].scriptWitness.stack.resize(1); |
| 4903 | block.vtx[0].wit.vtxinwit[0].scriptWitness.stack[0] = nonce; |
| 4904 | } |
| 4905 | } |
| 4906 | |
| 4907 | std::vector<unsigned char> GenerateCoinbaseCommitment(CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams, bool fProofOfStake) |
| 4908 | { |
no test coverage detected