From 771d5d8b84746dbcab5fd6b413e8c2b6161cc6b2 Mon Sep 17 00:00:00 2001 From: dimxy Date: Fri, 10 May 2019 12:39:52 +0500 Subject: [PATCH] added > 5342 height --- src/cc/prices.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/cc/prices.cpp b/src/cc/prices.cpp index edcd430f4..fb5bd363b 100644 --- a/src/cc/prices.cpp +++ b/src/cc/prices.cpp @@ -1630,6 +1630,12 @@ int32_t prices_getbetinfo(uint256 bettxid, BetInfo &betinfo) if (hashBlock.IsNull()) return -2; + + // TODO: forget old tx + CBlockIndex *bi = komodo_getblockindex(hashBlock); + if (bi && bi->GetHeight() > 5342) + return -5; + OneBetData bet1; if (prices_betopretdecode(bettx.vout.back().scriptPubKey, betinfo.pk, bet1.firstheight, bet1.positionsize, betinfo.leverage, betinfo.firstprice, betinfo.vecparsed, betinfo.tokenid) == 'B') { @@ -2002,6 +2008,12 @@ UniValue PricesList(uint32_t filter, CPubKey mypk) if (GetTransaction(txid, vintx, hashBlock, false) != 0) { + + // TODO: forget old tx + CBlockIndex *bi = komodo_getblockindex(hashBlock); + if (bi && bi->GetHeight() > 5342) + return; + bool bAppend = false; if (vintx.vout.size() > 0 && prices_betopretdecode(vintx.vout.back().scriptPubKey, pk, height, amount, leverage, firstprice, vec, tokenid) == 'B' && (mypk == CPubKey() || mypk == pk)) // if only mypubkey to list