corr arithmetic normalization

This commit is contained in:
dimxy
2019-04-27 15:42:48 +05:00
parent 87571e8457
commit 3bf8ab37b5

View File

@@ -1345,7 +1345,7 @@ UniValue PricesInfo(uint256 bettxid, int32_t refheight)
std::cerr << "PricesInfo() " << " totalbets=" << (totalbets / PRICES_NORMFACTOR) << std::endl;
if (totalbets != 0) { //prevent zero div
costbasis /= totalbets;
costbasis /= PRICES_NORMFACTOR; //denormalization
costbasis *= PRICES_NORMFACTOR; //denormalization
}
else
costbasis = 0;