Test
This commit is contained in:
@@ -327,24 +327,27 @@ bool ProcessAssets(Eval* eval, std::vector<uint8_t> paramsNull,const CTransactio
|
||||
txid = ctx.GetHash();
|
||||
if ( txid == prevtxid )
|
||||
return(true);
|
||||
fprintf(stderr,"ProcessAssets\n");
|
||||
if ( paramsNull.size() != 0 ) // Don't expect params
|
||||
return eval->Invalid("Cannot have params");
|
||||
else if ( (n= ctx.vout.size()) == 0 )
|
||||
return eval->Invalid("no-vouts");
|
||||
else if ( (funcid= DecodeAssetOpRet(ctx.vout[n-1].scriptPubKey,assetid,assetid2,amount,origpubkey)) == 0 )
|
||||
return eval->Invalid("Invalid opreturn payload");
|
||||
if ( eval->GetTxUnconfirmed(assetid,createTx,hashBlock) == 0 )
|
||||
return eval->Invalid("cant find asset create txid");
|
||||
if ( assetid2 != zero && eval->GetTxUnconfirmed(assetid2,createTx,hashBlock) == 0 )
|
||||
return eval->Invalid("cant find asset2 create txid");
|
||||
if ( AssetValidate(eval,ctx,n,funcid,assetid,assetid2,amount,origpubkey) != 0 )
|
||||
{
|
||||
prevtxid = txid;
|
||||
fprintf(stderr,"AssetValidate passed\n");
|
||||
return(true);
|
||||
LOCK(cs_main);
|
||||
fprintf(stderr,"ProcessAssets\n");
|
||||
if ( paramsNull.size() != 0 ) // Don't expect params
|
||||
return eval->Invalid("Cannot have params");
|
||||
else if ( (n= ctx.vout.size()) == 0 )
|
||||
return eval->Invalid("no-vouts");
|
||||
else if ( (funcid= DecodeAssetOpRet(ctx.vout[n-1].scriptPubKey,assetid,assetid2,amount,origpubkey)) == 0 )
|
||||
return eval->Invalid("Invalid opreturn payload");
|
||||
if ( eval->GetTxUnconfirmed(assetid,createTx,hashBlock) == 0 )
|
||||
return eval->Invalid("cant find asset create txid");
|
||||
if ( assetid2 != zero && eval->GetTxUnconfirmed(assetid2,createTx,hashBlock) == 0 )
|
||||
return eval->Invalid("cant find asset2 create txid");
|
||||
if ( AssetValidate(eval,ctx,n,funcid,assetid,assetid2,amount,origpubkey) != 0 )
|
||||
{
|
||||
prevtxid = txid;
|
||||
fprintf(stderr,"AssetValidate passed\n");
|
||||
return(true);
|
||||
}
|
||||
fprintf(stderr,"AssetValidate failed\n");
|
||||
}
|
||||
fprintf(stderr,"AssetValidate failed\n");
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -4483,11 +4483,11 @@ bool ProcessNewBlock(bool from_miner,int32_t height,CValidationState &state, CNo
|
||||
auto verifier = libzcash::ProofVerifier::Disabled();
|
||||
hash = pblock->GetHash();
|
||||
fprintf(stderr,"ProcessBlock %d\n",(int32_t)chainActive.LastTip()->nHeight);
|
||||
if ( chainActive.LastTip() != 0 )
|
||||
komodo_currentheight_set(chainActive.LastTip()->nHeight);
|
||||
checked = CheckBlock(&futureblock,height!=0?height:komodo_block2height(pblock),0,*pblock, state, verifier,0);
|
||||
{
|
||||
LOCK(cs_main);
|
||||
if ( chainActive.LastTip() != 0 )
|
||||
komodo_currentheight_set(chainActive.LastTip()->nHeight);
|
||||
checked = CheckBlock(&futureblock,height!=0?height:komodo_block2height(pblock),0,*pblock, state, verifier,0);
|
||||
bool fRequested = MarkBlockAsReceived(hash);
|
||||
fRequested |= fForceProcessing;
|
||||
if ( checked != 0 && komodo_checkPOW(0,pblock,height) < 0 ) //from_miner && ASSETCHAINS_STAKED == 0
|
||||
|
||||
Reference in New Issue
Block a user