remove hack

This commit is contained in:
blackjok3r
2018-10-29 21:57:48 +08:00
parent b64c592e07
commit f8074b7049

View File

@@ -443,7 +443,7 @@ bool DiceVerifyTimeout(CTransaction &betTx,int32_t timeoutblocks)
bool DiceValidate(struct CCcontract_info *cp,Eval *eval,const CTransaction &tx) bool DiceValidate(struct CCcontract_info *cp,Eval *eval,const CTransaction &tx)
{ {
uint256 txid,fundingtxid,vinfundingtxid,vinhentropy,vinproof,hashBlock,hash,proof,entropy; int64_t minbet,maxbet,maxodds,timeoutblocks,odds,winnings; uint64_t vinsbits,sbits,amount,inputs,outputs,txfee=10000; int32_t numvins,numvouts,preventCCvins,preventCCvouts,i,iswin; uint8_t funcid; CScript fundingPubKey; CTransaction fundingTx,vinTx,vinofvinTx; char CCaddr[64]; uint256 txid,fundingtxid,vinfundingtxid,vinhentropy,vinproof,hashBlock,hash,proof,entropy; int64_t minbet,maxbet,maxodds,timeoutblocks,odds,winnings; uint64_t vinsbits,sbits,amount,inputs,outputs,txfee=10000; int32_t numvins,numvouts,preventCCvins,preventCCvouts,i,iswin; uint8_t funcid; CScript fundingPubKey; CTransaction fundingTx,vinTx,vinofvinTx; char CCaddr[64];
CBlockIndex block; int skipped = 0; CBlockIndex block;
numvins = tx.vin.size(); numvins = tx.vin.size();
numvouts = tx.vout.size(); numvouts = tx.vout.size();
preventCCvins = preventCCvouts = -1; preventCCvins = preventCCvouts = -1;
@@ -551,8 +551,7 @@ bool DiceValidate(struct CCcontract_info *cp,Eval *eval,const CTransaction &tx)
else if ( eval->GetTxUnconfirmed(tx.vin[1].prevout.hash,vinTx,hashBlock) == 0 ) { else if ( eval->GetTxUnconfirmed(tx.vin[1].prevout.hash,vinTx,hashBlock) == 0 ) {
char str[65],str2[65],str3[65]; char str[65],str2[65],str3[65];
fprintf(stderr, "txid.%s tx.%s hashBlock.%s\n",uint256_str(str,txid),uint256_str(str2,tx.vin[1].prevout.hash),uint256_str(str3,hashBlock)); fprintf(stderr, "txid.%s tx.%s hashBlock.%s\n",uint256_str(str,txid),uint256_str(str2,tx.vin[1].prevout.hash),uint256_str(str3,hashBlock));
//return eval->Invalid("always should find looking vin.0, but didnt for wlt"); return eval->Invalid("always should find looking vin.0, but didnt for wlt");
skipped = 1;
} else if (hashBlock.IsNull() || !eval->GetBlock(hashBlock, block)) } else if (hashBlock.IsNull() || !eval->GetBlock(hashBlock, block))
return eval->Invalid(" TX not confirmed! always should find vin.0, but didnt for wlt"); return eval->Invalid(" TX not confirmed! always should find vin.0, but didnt for wlt");
else if ( vinTx.vout.size() < 3 || DecodeDiceOpRet(tx.vin[1].prevout.hash,vinTx.vout[vinTx.vout.size()-1].scriptPubKey,vinsbits,vinfundingtxid,vinhentropy,vinproof) != 'B' ) else if ( vinTx.vout.size() < 3 || DecodeDiceOpRet(tx.vin[1].prevout.hash,vinTx.vout[vinTx.vout.size()-1].scriptPubKey,vinsbits,vinfundingtxid,vinhentropy,vinproof) != 'B' )
@@ -575,8 +574,6 @@ bool DiceValidate(struct CCcontract_info *cp,Eval *eval,const CTransaction &tx)
iswin = -1; iswin = -1;
} }
else else
{
if ( skipped == 0 )
{ {
//vout.0: funding CC change to entropy owner //vout.0: funding CC change to entropy owner
//vout.2: normal output to bettor's address //vout.2: normal output to bettor's address
@@ -600,7 +597,6 @@ bool DiceValidate(struct CCcontract_info *cp,Eval *eval,const CTransaction &tx)
} }
iswin = (funcid == 'W'); iswin = (funcid == 'W');
} }
}
if ( iswin != 0 ) if ( iswin != 0 )
{ {
//char str[65],str2[65]; //char str[65],str2[65];