MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / UpdateUncommittedBlockStructures

Function UpdateUncommittedBlockStructures

src/validation.cpp:3397–3407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3395}
3396
3397void UpdateUncommittedBlockStructures(CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams)
3398{
3399 int commitpos = GetWitnessCommitmentIndex(block);
3400 static const std::vector<unsigned char> nonce(32, 0x00);
3401 if (commitpos != -1 && IsWitnessEnabled(pindexPrev, consensusParams) && !block.vtx[0]->HasWitness()) {
3402 CMutableTransaction tx(*block.vtx[0]);
3403 tx.vin[0].scriptWitness.stack.resize(1);
3404 tx.vin[0].scriptWitness.stack[0] = nonce;
3405 block.vtx[0] = MakeTransactionRef(std::move(tx));
3406 }
3407}
3408
3409std::vector<unsigned char> GenerateCoinbaseCommitment(CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams)
3410{

Callers 2

submitblockFunction · 0.85

Calls 5

IsWitnessEnabledFunction · 0.85
MakeTransactionRefFunction · 0.85
HasWitnessMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected