Test
This commit is contained in:
@@ -25,7 +25,7 @@ bool DiceValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx);
|
|||||||
|
|
||||||
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);
|
||||||
std::string DiceBetFinish(int32_t *resultp,uint64_t txfee,char *planstr,uint256 fundingtxid,uint256 bettxid,int32_t winlosetimeout);
|
std::string DiceBetFinish(int32_t *resultp,uint64_t txfee,char *planstr,uint256 fundingtxid,uint256 bettxid,int32_t winlosetimeout);
|
||||||
std::string DiceStatus(uint64_t txfee,char *planstr,uint256 fundingtxid,uint256 bettxid);
|
double DiceStatus(uint64_t txfee,char *planstr,uint256 fundingtxid,uint256 bettxid);
|
||||||
std::string DiceCreateFunding(uint64_t txfee,char *planstr,int64_t funds,int64_t minbet,int64_t maxbet,int64_t maxodds,int64_t timeoutblocks);
|
std::string DiceCreateFunding(uint64_t txfee,char *planstr,int64_t funds,int64_t minbet,int64_t maxbet,int64_t maxodds,int64_t timeoutblocks);
|
||||||
std::string DiceAddfunding(uint64_t txfee,char *planstr,uint256 fundingtxid,int64_t amount);
|
std::string DiceAddfunding(uint64_t txfee,char *planstr,uint256 fundingtxid,int64_t amount);
|
||||||
UniValue DiceInfo(uint256 diceid);
|
UniValue DiceInfo(uint256 diceid);
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ void *dicefinish(void *_ptr)
|
|||||||
//fprintf(stderr,"duplicate.%d dicefinish.%d %s funding.%s bet.%s\n",duplicate,ptr->iswin,name,uint256_str(str,ptr->fundingtxid),uint256_str(str2,ptr->bettxid));
|
//fprintf(stderr,"duplicate.%d dicefinish.%d %s funding.%s bet.%s\n",duplicate,ptr->iswin,name,uint256_str(str,ptr->fundingtxid),uint256_str(str2,ptr->bettxid));
|
||||||
if ( duplicate == 0 )
|
if ( duplicate == 0 )
|
||||||
{
|
{
|
||||||
res = DiceWinLoseTimeout(&result,0,name,ptr->fundingtxid,ptr->bettxid,ptr->iswin);
|
res = DiceBetFinish(&result,0,name,ptr->fundingtxid,ptr->bettxid,ptr->iswin);
|
||||||
if ( result != 0 )
|
if ( result != 0 )
|
||||||
mySendrawtransaction(res);
|
mySendrawtransaction(res);
|
||||||
}
|
}
|
||||||
@@ -997,13 +997,14 @@ std::string DiceBetFinish(int32_t *resultp,uint64_t txfee,char *planstr,uint256
|
|||||||
|
|
||||||
double DiceStatus(uint64_t txfee,char *planstr,uint256 fundingtxid,uint256 bettxid)
|
double DiceStatus(uint64_t txfee,char *planstr,uint256 fundingtxid,uint256 bettxid)
|
||||||
{
|
{
|
||||||
CScript fundingPubKey; CTransaction spenttx; uint256 hashBlock,spenttxid; CPubKey mypk,dicepk,fundingpk; struct CCcontract_info *cp,C; int32_t result,vout; int64_t minbet,maxbet,maxodds,timeoutblocks; uint64_t sbits; char resultstr[64]; std::string res;
|
CScript fundingPubKey,scriptPubKey; CTransaction spenttx; uint256 hashBlock,spenttxid; CPubKey mypk,dicepk,fundingpk; struct CCcontract_info *cp,C; int32_t result,vout; int64_t minbet,maxbet,maxodds,timeoutblocks; uint64_t sbits; char resultstr[64]; std::string res;
|
||||||
if ( (cp= Diceinit(fundingPubKey,fundingtxid,&C,planstr,txfee,mypk,dicepk,sbits,minbet,maxbet,maxodds,timeoutblocks)) == 0 )
|
if ( (cp= Diceinit(fundingPubKey,fundingtxid,&C,planstr,txfee,mypk,dicepk,sbits,minbet,maxbet,maxodds,timeoutblocks)) == 0 )
|
||||||
{
|
{
|
||||||
fprintf(stderr,"Diceinit error\n");
|
fprintf(stderr,"Diceinit error\n");
|
||||||
return(0.);
|
return(0.);
|
||||||
}
|
}
|
||||||
fundingpk = DiceFundingPk(fundingPubKey);
|
fundingpk = DiceFundingPk(fundingPubKey);
|
||||||
|
scriptPubKey = CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG;
|
||||||
if ( bettxid == zeroid ) // scan
|
if ( bettxid == zeroid ) // scan
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user