Compute at which vout of the block's coinbase transaction the witness commitment occurs, or -1 if not found.
| 3382 | // Compute at which vout of the block's coinbase transaction the witness |
| 3383 | // commitment occurs, or -1 if not found. |
| 3384 | static int GetWitnessCommitmentIndex(const CBlock& block) |
| 3385 | { |
| 3386 | int commitpos = -1; |
| 3387 | if (!block.vtx.empty()) { |
| 3388 | for (size_t o = 0; o < block.vtx[0]->vout.size(); o++) { |
| 3389 | if (block.vtx[0]->vout[o].scriptPubKey.size() >= 38 && block.vtx[0]->vout[o].scriptPubKey[0] == OP_RETURN && block.vtx[0]->vout[o].scriptPubKey[1] == 0x24 && block.vtx[0]->vout[o].scriptPubKey[2] == 0xaa && block.vtx[0]->vout[o].scriptPubKey[3] == 0x21 && block.vtx[0]->vout[o].scriptPubKey[4] == 0xa9 && block.vtx[0]->vout[o].scriptPubKey[5] == 0xed) { |
| 3390 | commitpos = o; |
| 3391 | } |
| 3392 | } |
| 3393 | } |
| 3394 | return commitpos; |
| 3395 | } |
| 3396 | |
| 3397 | void UpdateUncommittedBlockStructures(CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams) |
| 3398 | { |
no test coverage detected