Return eval->error

This commit is contained in:
jl777
2018-11-07 00:29:34 -11:00
parent 86cecf71d1
commit 4148e39f73
5 changed files with 9 additions and 9 deletions

View File

@@ -322,7 +322,7 @@ bool AssetsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx
fprintf(stderr,"fill validated\n");
break;
case 'E': // fillexchange
return(false);
return eval->Invalid("unexpected assets fillexchange funcid");
break; // disable asset swaps
//vin.0: normal input
//vin.1: unspendable.(vout.0 assetoshis from selloffer) sellTx.vout[0]
@@ -374,7 +374,7 @@ bool AssetsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx
break;
default:
fprintf(stderr,"illegal assets funcid.(%c)\n",funcid);
return(false);
return eval->Invalid("unexpected assets funcid");
break;
}
return(PreventCC(eval,tx,preventCCvins,numvins,preventCCvouts,numvouts));

View File

@@ -350,7 +350,7 @@ bool ChannelsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &
break;
default:
fprintf(stderr,"illegal channels funcid.(%c)\n",funcid);
return(false);
return eval->Invalid("unexpected channels funcid");
break;
}
}

View File

@@ -597,11 +597,11 @@ bool DiceValidate(struct CCcontract_info *cp,Eval *eval,const CTransaction &tx)
return eval->Invalid("always should find vinofvin.0, but didnt for bet");
else if ( vinTx.vin[0].prevout.hash != fundingtxid )
{
if ( vinofvinTx.vout[1].scriptPubKey != fundingPubKey )
//if ( vinofvinTx.vout[vinTx.vin[0].prevout.n].scriptPubKey != fundingPubKey )
//if ( vinofvinTx.vout[1].scriptPubKey != fundingPubKey )
if ( vinofvinTx.vout[vinTx.vin[0].prevout.n].scriptPubKey != fundingPubKey )
{
uint8_t *ptr0,*ptr1; int32_t i; char str[65];
fprintf(stderr,"bidTx.%s\n",uint256_str(str,txid));
fprintf(stderr,"betTx.%s\n",uint256_str(str,txid));
fprintf(stderr,"entropyTx.%s v%d\n",uint256_str(str,tx.vin[0].prevout.hash),(int32_t)tx.vin[0].prevout.n);
fprintf(stderr,"entropyTx vin0 %s v%d\n",uint256_str(str,vinTx.vin[0].prevout.hash),(int32_t)vinTx.vin[0].prevout.n);
ptr0 = (uint8_t *)vinofvinTx.vout[vinTx.vin[0].prevout.n].scriptPubKey.data();
@@ -701,7 +701,7 @@ bool DiceValidate(struct CCcontract_info *cp,Eval *eval,const CTransaction &tx)
break;
default:
fprintf(stderr,"illegal dice funcid.(%c)\n",funcid);
return(false);
return eval->Invalid("unexpected dice funcid");
break;
}
}

View File

@@ -653,7 +653,7 @@ bool OraclesValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &t
break;
default:
fprintf(stderr,"illegal oracles funcid.(%c)\n",script[1]);
return(false);
return eval->Invalid("unexpected OraclesValidate funcid");
break;
}
}

View File

@@ -289,7 +289,7 @@ bool RewardsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &t
break;
default:
fprintf(stderr,"illegal rewards funcid.(%c)\n",funcid);
return(false);
return eval->Invalid("unexpected rewards funcid");
break;
}
}