From 267e6f7ad57cc6d829eb8b744b4c814ca2e2589b Mon Sep 17 00:00:00 2001 From: DanS Date: Thu, 27 Aug 2026 14:14:41 -0500 Subject: [PATCH] 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) --- src/main.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c15049253..6bc40c659 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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 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 ) - { - if ( hush_opretvalidate(block,previndex,nHeight,tx.vout[tx.vout.size()-1].scriptPubKey) < 0 ) - return(false); - } + // The only coinbase-specific contextual check here was CBOPRET price-oracle + // validation (hush_opretvalidate), gated on ASSETCHAINS_CBOPRET, which is always + // 0 on DragonX (no -ac_cbopret). With that dead path removed there is nothing left + // to validate, so a DragonX coinbase is unconditionally valid at this stage. return(true); }