Fix dice finish

This commit is contained in:
jl777
2018-08-14 03:44:36 -11:00
parent 0e03d55920
commit db871af56f
2 changed files with 8 additions and 5 deletions

View File

@@ -968,7 +968,7 @@ std::string DiceBetFinish(int32_t *resultp,uint64_t txfee,char *planstr,uint256
fprintf(stderr,"illegal odds.%d vs maxodds.%d\n",(int32_t)odds,(int32_t)maxodds);
return("");
}
CCchange = betTx.vout[0].nValue;
CCchange = betTx.vout[0].nValue + betTx.vout[1];
fundsneeded = txfee + odds*betTx.vout[1].nValue;
if ( CCchange >= fundsneeded+betTx.vout[1].nValue )
CCchange -= (fundsneeded + betTx.vout[1].nValue);