Revert default case in oracles

This commit is contained in:
jl777
2018-11-07 00:41:45 -11:00
parent 4148e39f73
commit 9bd498e60e
2 changed files with 6 additions and 5 deletions

View File

@@ -801,7 +801,7 @@ int64_t DicePlanFunds(uint64_t &entropyval,uint256 &entropytxid,uint64_t refsbit
if ( first == 0 && (funcid == 'E' || funcid == 'W' || funcid == 'L') ) if ( first == 0 && (funcid == 'E' || funcid == 'W' || funcid == 'L') )
{ {
//fprintf(stderr,"check first\n"); //fprintf(stderr,"check first\n");
if ( fundingPubKey == tx.vout[1].scriptPubKey ) if ( tx.vout.size() > 1 && fundingPubKey == tx.vout[1].scriptPubKey )
{ {
if ( funcid == 'E' && fundingtxid != tx.vin[0].prevout.hash ) if ( funcid == 'E' && fundingtxid != tx.vin[0].prevout.hash )
{ {
@@ -826,6 +826,7 @@ int64_t DicePlanFunds(uint64_t &entropyval,uint256 &entropytxid,uint64_t refsbit
} //else fprintf(stderr,"not E or is funding\n"); } //else fprintf(stderr,"not E or is funding\n");
entropytxid = txid; entropytxid = txid;
entropyval = tx.vout[0].nValue; entropyval = tx.vout[0].nValue;
fprintf(stderr,"entropytxid.%s val %.8f\n",txid.GetHex().c_str(),(double)entropyval/COIN);
first = 1; first = 1;
if (random) { if (random) {
fprintf(stderr, "chosen entropy on loop: %d\n",loops); fprintf(stderr, "chosen entropy on loop: %d\n",loops);

View File

@@ -651,10 +651,10 @@ bool OraclesValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &t
} }
return eval->Invalid("unexpected OraclesValidate 'D' tx invalid"); return eval->Invalid("unexpected OraclesValidate 'D' tx invalid");
break; break;
default: //default:
fprintf(stderr,"illegal oracles funcid.(%c)\n",script[1]); // fprintf(stderr,"illegal oracles funcid.(%c)\n",script[1]);
return eval->Invalid("unexpected OraclesValidate funcid"); // return eval->Invalid("unexpected OraclesValidate funcid");
break; // break;
} }
} }
return(PreventCC(eval,tx,preventCCvins,numvins,preventCCvouts,numvouts)); return(PreventCC(eval,tx,preventCCvins,numvins,preventCCvouts,numvouts));