This commit is contained in:
jl777
2018-08-01 00:58:40 -11:00
parent 502dad4679
commit 3d473d99ca

View File

@@ -432,7 +432,9 @@ bool DiceValidate(struct CCcontract_info *cp,Eval *eval,const CTransaction &tx)
return eval->Invalid("vout[2] nValue violation for bet"); return eval->Invalid("vout[2] nValue violation for bet");
else if ( eval->GetTxUnconfirmed(vinTx.vin[0].prevout.hash,vinofvinTx,hashBlock) == 0 || vinofvinTx.vout.size() < 1 ) else if ( eval->GetTxUnconfirmed(vinTx.vin[0].prevout.hash,vinofvinTx,hashBlock) == 0 || vinofvinTx.vout.size() < 1 )
return eval->Invalid("always should find vinofvin.0, but didnt for bet"); return eval->Invalid("always should find vinofvin.0, but didnt for bet");
else if ( vinofvinTx.vout[0].scriptPubKey != fundingPubKey ) else if ( vinTx.vin[0].prevout.hash != fundingtxid )
{
if ( vinofvinTx.vout[0].scriptPubKey != fundingPubKey )
{ {
uint8_t *ptr0,*ptr1; int32_t i; char str[65]; uint8_t *ptr0,*ptr1; int32_t i; char str[65];
fprintf(stderr,"bidTx.%s\n",uint256_str(str,txid)); fprintf(stderr,"bidTx.%s\n",uint256_str(str,txid));
@@ -448,8 +450,9 @@ bool DiceValidate(struct CCcontract_info *cp,Eval *eval,const CTransaction &tx)
fprintf(stderr," (%c) entropy vin.%d fundingPubKey mismatch %s\n",funcid,vinTx.vin[0].prevout.n,uint256_str(str,vinTx.vin[0].prevout.hash)); fprintf(stderr," (%c) entropy vin.%d fundingPubKey mismatch %s\n",funcid,vinTx.vin[0].prevout.n,uint256_str(str,vinTx.vin[0].prevout.hash));
return eval->Invalid("vin1 of entropy tx not fundingPubKey for bet"); return eval->Invalid("vin1 of entropy tx not fundingPubKey for bet");
} }
else if ( vinTx.vout[vinTx.vin[0].prevout.n].nValue != tx.vout[0].nValue ) else if ( vinofvinTx.vout[vinTx.vin[0].prevout.n].nValue != tx.vout[0].nValue )
return eval->Invalid("vout.0 nValue != entropy nValue for bet"); return eval->Invalid("vout.0 nValue != entropy nValue for bet");
}
if ( (iswin= DiceIsWinner(entropy,txid,tx,vinTx,hash,sbits,minbet,maxbet,maxodds,timeoutblocks,fundingtxid)) != 0 ) if ( (iswin= DiceIsWinner(entropy,txid,tx,vinTx,hash,sbits,minbet,maxbet,maxodds,timeoutblocks,fundingtxid)) != 0 )
{ {
// will only happen for fundingPubKey // will only happen for fundingPubKey