]> Git Repo - VerusCoin.git/commitdiff
Info funding to return total funding
authorjl777 <[email protected]>
Tue, 31 Jul 2018 09:53:46 +0000 (22:53 -1100)
committerjl777 <[email protected]>
Tue, 31 Jul 2018 09:53:46 +0000 (22:53 -1100)
src/cc/dice.cpp

index d4f908c298fb6e0d708fd04d4e9f2adac23333ed..9425fcee33b3e58ef99cfbfc65788118839bae7e 100644 (file)
@@ -551,7 +551,7 @@ struct CCcontract_info *Diceinit(uint256 reffundingtxid,struct CCcontract_info *
 
 UniValue DiceInfo(uint256 diceid)
 {
 
 UniValue DiceInfo(uint256 diceid)
 {
-    UniValue result(UniValue::VOBJ); uint256 hashBlock; CTransaction vintx; int64_t minbet,maxbet,maxodds,timeoutblocks; uint64_t sbits; char str[67],numstr[65];
+    UniValue result(UniValue::VOBJ); CPubKey dicepk; uint256 hashBlock,entropytxid; CTransaction vintx; int64_t minbet,maxbet,maxodds,timeoutblocks; uint64_t sbits,funding,entropyval; char str[67],numstr[65]; struct CCcontract_info *cp,C;
     if ( GetTransaction(diceid,vintx,hashBlock,false) == 0 )
     {
         fprintf(stderr,"cant find fundingtxid\n");
     if ( GetTransaction(diceid,vintx,hashBlock,false) == 0 )
     {
         fprintf(stderr,"cant find fundingtxid\n");
@@ -575,7 +575,10 @@ UniValue DiceInfo(uint256 diceid)
     result.push_back(Pair("maxbet",numstr));
     result.push_back(Pair("maxodds",maxodds));
     result.push_back(Pair("timeoutblocks",timeoutblocks));
     result.push_back(Pair("maxbet",numstr));
     result.push_back(Pair("maxodds",maxodds));
     result.push_back(Pair("timeoutblocks",timeoutblocks));
-    sprintf(numstr,"%.8f",(double)vintx.vout[0].nValue/COIN);
+    cp = CCinit(&C,EVAL_DICE);
+    dicepk = GetUnspendable(cp,0);
+    funding = DicePlanFunds(entropyval,entropytxid,sbits,cp,dicepk,fundingtxid);
+    sprintf(numstr,"%.8f",(double)funding/COIN);
     result.push_back(Pair("funding",numstr));
     return(result);
 }
     result.push_back(Pair("funding",numstr));
     return(result);
 }
This page took 0.030697 seconds and 4 git commands to generate.