init uninited total vars

This commit is contained in:
dimxy
2019-05-10 15:40:00 +05:00
parent a6194b8c04
commit 239cc223e4

View File

@@ -125,6 +125,10 @@ typedef struct TotalFund {
int64_t totalRekt; int64_t totalRekt;
int64_t totalEquity; int64_t totalEquity;
TotalFund() {
totalFund = totalBets = totalRekt = totalEquity = 0;
}
} TotalFund; } TotalFund;
int32_t prices_syntheticprofits(int64_t &costbasis, int32_t firstheight, int32_t height, int16_t leverage, std::vector<uint16_t> vec, int64_t positionsize, int64_t &profits, int64_t &outprice); int32_t prices_syntheticprofits(int64_t &costbasis, int32_t firstheight, int32_t height, int16_t leverage, std::vector<uint16_t> vec, int64_t positionsize, int64_t &profits, int64_t &outprice);
@@ -2198,6 +2202,10 @@ void prices_getorderbook(std::map<std::string, std::vector<BetInfo> > & bookmatc
// calc total fund amount // calc total fund amount
fundTotals.totalFund = 0; fundTotals.totalFund = 0;
fundTotals.totalRekt = 0;
fundTotals.totalEquity = 0;
fundTotals.totalBets = 0;
std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> > addressCCunspents; std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> > addressCCunspents;
SetCCunspents(addressCCunspents, cp->unspendableCCaddr, true); // cc marker SetCCunspents(addressCCunspents, cp->unspendableCCaddr, true); // cc marker
for (std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> >::const_iterator it = addressCCunspents.begin(); it != addressCCunspents.end(); it++) for (std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> >::const_iterator it = addressCCunspents.begin(); it != addressCCunspents.end(); it++)