try
This commit is contained in:
@@ -945,7 +945,7 @@ std::string DiceAddfunding(uint64_t txfee,char *planstr,uint256 fundingtxid,int6
|
||||
return("");
|
||||
}
|
||||
|
||||
std::string DiceBet(uint64_t txfee,char *planstr,uint256 fundingtxid,int64_t bet,int32_t odds)
|
||||
std::string DiceBet(uint64_t txfee,char *planstr,uint256 fundingtxid,int64_t bet,int32_t odds, char *error)
|
||||
{
|
||||
CMutableTransaction mtx; CScript fundingPubKey; CPubKey mypk,dicepk; uint64_t sbits,entropyval; int64_t funding,minbet,maxbet,maxodds,timeoutblocks; uint256 entropytxid,entropy,hentropy; struct CCcontract_info *cp,C;
|
||||
if ( bet < 0 )
|
||||
@@ -974,6 +974,7 @@ std::string DiceBet(uint64_t txfee,char *planstr,uint256 fundingtxid,int64_t bet
|
||||
if ( entropytxs < 2 ) {
|
||||
CCerror = "Your dealer is broke, find a new casino.";
|
||||
fprintf(stderr,"%s\n", CCerror.c_str() );
|
||||
error = CCerror.c_str();
|
||||
return("");
|
||||
}
|
||||
if ( myIsutxo_spentinmempool(entropytxid,0) != 0 )
|
||||
@@ -990,7 +991,7 @@ std::string DiceBet(uint64_t txfee,char *planstr,uint256 fundingtxid,int64_t bet
|
||||
mtx.vout.push_back(MakeCC1vout(cp->evalcode,bet,dicepk));
|
||||
mtx.vout.push_back(CTxOut(txfee+odds,CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG));
|
||||
return(FinalizeCCTx(0,cp,mtx,mypk,txfee,EncodeDiceOpRet('B',sbits,fundingtxid,entropy,zeroid)));
|
||||
} else fprintf(stderr,"cant find enough normal inputs for %.8f, plan funding %.8f\n",(double)bet/COIN,(double)funding/COIN);
|
||||
} else CCerror = "cant find enough normal inputs for %.8f, plan funding %.8f\n";
|
||||
}
|
||||
if ( entropyval == 0 && funding != 0 )
|
||||
CCerror = "cant find dice entropy inputs";
|
||||
|
||||
Reference in New Issue
Block a user