This commit is contained in:
blackjok3r
2018-10-29 11:55:42 +08:00
parent 05dc40eb3e
commit 2e05c9efce

View File

@@ -551,7 +551,14 @@ bool DiceValidate(struct CCcontract_info *cp,Eval *eval,const CTransaction &tx)
else if ( tx.vin[1].prevout.hash != tx.vin[2].prevout.hash )
return eval->Invalid("vin0 != vin1 prevout.hash for bet");
else if ( eval->GetTxUnconfirmed(tx.vin[1].prevout.hash,vinTx,hashBlock) == 0 ) {
return eval->Invalid("always should find vin.0, but didnt for wlt");
int tries = 0;
while ( eval->GetTxUnconfirmed(tx.vin[1].prevout.hash,vinTx,hashBlock) == 0 ) {
tries++;
sleep(1);
if ( tries > 60 ) {
return eval->Invalid("always should find after 60s of looking vin.0, but didnt for wlt");
}
}
} else if (hashBlock.IsNull() || !eval->GetBlock(hashBlock, block))
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' )