Check tx during mining
This commit is contained in:
@@ -2227,7 +2227,7 @@ namespace Consensus {
|
|||||||
// Ensure that coinbases are matured
|
// Ensure that coinbases are matured
|
||||||
if (nSpendHeight - coins->nHeight < COINBASE_MATURITY) {
|
if (nSpendHeight - coins->nHeight < COINBASE_MATURITY) {
|
||||||
return state.Invalid(
|
return state.Invalid(
|
||||||
error("CheckInputs(): tried to spend coinbase at depth %d", nSpendHeight - coins->nHeight),
|
error("CheckInputs(): tried to spend coinbase at depth %d/%d", nSpendHeight - coins->nHeight,(int32_t)COINBASE_MATURITY),
|
||||||
REJECT_INVALID, "bad-txns-premature-spend-of-coinbase");
|
REJECT_INVALID, "bad-txns-premature-spend-of-coinbase");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -335,6 +335,15 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn,int32_t gpucount)
|
|||||||
//fprintf(stderr,"dont have inputs\n");
|
//fprintf(stderr,"dont have inputs\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
CValidationState state;
|
||||||
|
auto verifier = libzcash::ProofVerifier::Disabled();
|
||||||
|
if ( !CheckTransaction(tx, state, verifier) )
|
||||||
|
{
|
||||||
|
fprintf(stderr,"skip tx.(%s) that failed CheckTransaction\n",txid.GetHex().c_str());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
CAmount nTxFees = view.GetValueIn(chainActive.LastTip()->nHeight,&interest,tx,chainActive.LastTip()->nTime)-tx.GetValueOut();
|
CAmount nTxFees = view.GetValueIn(chainActive.LastTip()->nHeight,&interest,tx,chainActive.LastTip()->nTime)-tx.GetValueOut();
|
||||||
|
|
||||||
nTxSigOps += GetP2SHSigOpCount(tx, view);
|
nTxSigOps += GetP2SHSigOpCount(tx, view);
|
||||||
|
|||||||
Reference in New Issue
Block a user