|
|
@ -1117,11 +1117,12 @@ uint64_t AddDiceInputs(struct CCcontract_info *cp,CMutableTransaction &mtx,CPubK |
|
|
|
unstringbits(sstr,sbits); |
|
|
|
if ( sbits == refsbits && (funcid == 'F' && reffundingtxid == txid) || reffundingtxid == fundingtxid ) |
|
|
|
{ |
|
|
|
if ( funcid == 'F' || funcid == 'E' || funcid == 'W' || funcid == 'L' || funcid == 'T' ) |
|
|
|
if ( funcid == 'R' || funcid == 'F' || funcid == 'E' || funcid == 'W' || funcid == 'L' || funcid == 'T' ) |
|
|
|
{ |
|
|
|
if ( total != 0 && maxinputs != 0 ) |
|
|
|
{ |
|
|
|
fprintf(stderr,"use (%c) %.8f %s %s/v%d\n",funcid,(double)tx.vout[0].nValue/COIN,sstr,uint256_str(str,txid),vout); |
|
|
|
if ( funcid == 'R' ) |
|
|
|
fprintf(stderr,">>>>>>>>>>>> use (%c) %.8f %s %s/v%d\n",funcid,(double)tx.vout[0].nValue/COIN,sstr,uint256_str(str,txid),vout); |
|
|
|
mtx.vin.push_back(CTxIn(txid,vout,CScript())); |
|
|
|
} |
|
|
|
totalinputs += it->second.satoshis; |
|
|
@ -1178,7 +1179,7 @@ int64_t DicePlanFunds(uint64_t &entropyval,uint256 &entropytxid,uint64_t refsbit |
|
|
|
if ( (funcid == 'F' && reffundingtxid == txid) || reffundingtxid == fundingtxid ) |
|
|
|
{ |
|
|
|
//fprintf(stderr,"%d: %s/v%d (%c %.8f) %.8f %.8f\n",n,uint256_str(str,txid),vout,funcid,(double)it->second.satoshis/COIN,(double)totalinputs/COIN,(double)sum/COIN);
|
|
|
|
if ( (nValue= IsDicevout(cp,tx,vout,refsbits,reffundingtxid)) >= 10000 && (funcid == 'F' || funcid == 'E' || funcid == 'W' || funcid == 'L' || funcid == 'T') ) |
|
|
|
if ( (nValue= IsDicevout(cp,tx,vout,refsbits,reffundingtxid)) >= 10000 && (funcid == 'R' || funcid == 'F' || funcid == 'E' || funcid == 'W' || funcid == 'L' || funcid == 'T') ) |
|
|
|
{ |
|
|
|
if ( funcid == 'L' || funcid == 'W' || funcid == 'E' ) |
|
|
|
n++; |
|
|
@ -1242,7 +1243,7 @@ int64_t DicePlanFunds(uint64_t &entropyval,uint256 &entropytxid,uint64_t refsbit |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else if ( funcid != 'B' ) |
|
|
|
else if ( 0 && funcid != 'B' ) |
|
|
|
fprintf(stderr,"%s %c refsbits.%llx sbits.%llx nValue %.8f\n",uint256_str(str,txid),funcid,(long long)refsbits,(long long)sbits,(double)nValue/COIN); |
|
|
|
} //else fprintf(stderr,"else case funcid (%c) %d %s vs %s\n",funcid,funcid,uint256_str(str,reffundingtxid),uint256_str(str2,fundingtxid));
|
|
|
|
} //else fprintf(stderr,"funcid.%d %c skipped %.8f\n",funcid,funcid,(double)tx.vout[vout].nValue/COIN);
|
|
|
@ -1578,7 +1579,8 @@ std::string DiceBetFinish(uint8_t &funcid,uint256 &entropyused,int32_t &entropyv |
|
|
|
mtx.vin.push_back(CTxIn(bettxid,0,CScript())); |
|
|
|
mtx.vin.push_back(CTxIn(bettxid,1,CScript())); |
|
|
|
funcid = 'R'; |
|
|
|
mtx.vout.push_back(CTxOut(betTx.vout[0].nValue,fundingPubKey)); |
|
|
|
mtx.vout.push_back(MakeCC1vout(cp->evalcode,betTx.vout[0].nValue,dicepk)); |
|
|
|
//mtx.vout.push_back(CTxOut(betTx.vout[0].nValue,fundingPubKey));
|
|
|
|
mtx.vout.push_back(CTxOut(txfee,fundingPubKey)); |
|
|
|
mtx.vout.push_back(CTxOut(betTx.vout[1].nValue,betTx.vout[2].scriptPubKey)); |
|
|
|
*resultp = 1; |
|
|
|