consensus: drop the dead CBOPRET price-validation from the coinbase check
Step 0 of the scoped HAC/HUSH3-drop work (the zero-risk, self-contained piece). ContextualCheckCoinbaseTransaction's only action was calling hush_opretvalidate() for CBOPRET price-oracle validation, gated on ASSETCHAINS_CBOPRET. On DragonX that global is always 0 (default 0, only ever set by -ac_cbopret, which DragonX never passes), so the branch is dead and the function already returns true for every DragonX coinbase. Remove the dead branch; the function is now unconditionally valid at this stage, which is behavior-identical on DragonX. Verified: a node self-mines and `verifychain` re-validates the whole chain (every coinbase re-checked through this function) = true. hush_opretvalidate (hush_gateway.h) is now unreferenced; its removal is part of the larger hush_gateway cleanup, tracked with the rest of the HAC/HUSH3-drop follow-up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1259,11 +1259,10 @@ unsigned int GetP2SHSigOpCount(const CTransaction& tx, const CCoinsViewCache& in
|
|||||||
// Ensure that a coinbase transaction is structured according to the consensus rules of the chain
|
// Ensure that a coinbase transaction is structured according to the consensus rules of the chain
|
||||||
bool ContextualCheckCoinbaseTransaction(int32_t slowflag,const CBlock *block,CBlockIndex * const previndex,const CTransaction& tx, const int nHeight,int32_t validateprices)
|
bool ContextualCheckCoinbaseTransaction(int32_t slowflag,const CBlock *block,CBlockIndex * const previndex,const CTransaction& tx, const int nHeight,int32_t validateprices)
|
||||||
{
|
{
|
||||||
if ( slowflag != 0 && ASSETCHAINS_CBOPRET != 0 && validateprices != 0 && nHeight > 0 && tx.vout.size() > 0 )
|
// The only coinbase-specific contextual check here was CBOPRET price-oracle
|
||||||
{
|
// validation (hush_opretvalidate), gated on ASSETCHAINS_CBOPRET, which is always
|
||||||
if ( hush_opretvalidate(block,previndex,nHeight,tx.vout[tx.vout.size()-1].scriptPubKey) < 0 )
|
// 0 on DragonX (no -ac_cbopret). With that dead path removed there is nothing left
|
||||||
return(false);
|
// to validate, so a DragonX coinbase is unconditionally valid at this stage.
|
||||||
}
|
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user