diff --git a/Silkcoin-qt.pro b/Silkcoin-qt.pro index a977e38..6fcb159 100644 --- a/Silkcoin-qt.pro +++ b/Silkcoin-qt.pro @@ -1,6 +1,6 @@ TEMPLATE = app TARGET = silkcoin-qt -VERSION = 1.1.0.22 +VERSION = 2.0.0.0 INCLUDEPATH += src src/json src/qt DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE @@ -227,7 +227,6 @@ HEADERS += \ src/qt/optionsmodel.h \ src/qt/overviewpage.h \ src/qt/poll.h \ - src/qt/poolbrowser.h \ src/qt/qcustomplot.h \ src/qt/qtipcserver.h \ src/qt/qvalidatedlineedit.h \ @@ -241,7 +240,6 @@ HEADERS += \ src/qt/sendmessagesdialog.h \ src/qt/sendmessagesentry.h \ src/qt/signverifymessagedialog.h \ - src/qt/statisticspage.h \ src/qt/transactiondesc.h \ src/qt/transactiondescdialog.h \ src/qt/transactionfilterproxy.h \ @@ -324,7 +322,6 @@ SOURCES += \ src/qt/optionsmodel.cpp \ src/qt/overviewpage.cpp \ src/qt/poll.cpp \ - src/qt/poolbrowser.cpp \ src/qt/qcustomplot.cpp \ src/qt/qtipcserver.cpp \ src/qt/qvalidatedlineedit.cpp \ @@ -335,7 +332,6 @@ SOURCES += \ src/qt/sendcoinsdialog.cpp \ src/qt/sendcoinsentry.cpp \ src/qt/signverifymessagedialog.cpp \ - src/qt/statisticspage.cpp \ src/qt/transactiondesc.cpp \ src/qt/transactiondescdialog.cpp \ src/qt/transactionfilterproxy.cpp \ @@ -389,7 +385,6 @@ FORMS += \ src/qt/forms/optionsdialog.ui \ src/qt/forms/overviewpage.ui \ src/qt/forms/poll.ui \ - src/qt/forms/poolbrowser.ui \ src/qt/forms/richlist.ui \ src/qt/forms/rpcconsole.ui \ src/qt/forms/sendcoinsdialog.ui \ @@ -397,7 +392,6 @@ FORMS += \ src/qt/forms/sendmessagesdialog.ui \ src/qt/forms/sendmessagesentry.ui \ src/qt/forms/signverifymessagedialog.ui \ - src/qt/forms/statisticspage.ui \ src/qt/forms/transactiondescdialog.ui \ src/qt/forms/tutoStackDialog.ui \ src/qt/forms/tutoWriteDialog.ui diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index 9c9a3bd..b99756a 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -32,6 +32,11 @@ static MapCheckpoints mapCheckpoints = (60001 , uint256("0x9040b2b79f4cce50b3d804f17d48359b62ebce467564defbf51af54c8dd9da83")) (87000 , uint256("0x6311aa124dda9ecfc854f98b5b981962f3fe46c6f55143f27769796a878a7ff9")) (113900, uint256("0x028a7f9bcd7532952106c29cb690f9af7938659fa4ae735fb2c80ca70bea0ee5")) + (165000, uint256("0x4eb6d22357961113dc1d44aab36e6f2943e016402f9053947c26affc6b407c06")) + (220000, uint256("0x67d729b3e1a6be9f662ba04dd7f748fcf1b7bab3a651a1a0b993bbc5ad02ee47")) + (280000, uint256("0x836e4e24ccd9aab052bb7f6ceea8d765a42a76713147ef1c3726865cef023943")) + (320000, uint256("0x7c0fa78de33510845146766769b855fa6fccd8c209a5bbb53035a64c761c34d9")) + (386000, uint256("0x606355657246ffb87907a50f567e4d46e05e612df228053a4b2a906057c1b25c")) ; // TestNet has no checkpoints diff --git a/src/clientversion.h b/src/clientversion.h index 807710b..240abd4 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -6,10 +6,10 @@ // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it -#define CLIENT_VERSION_MAJOR 1 -#define CLIENT_VERSION_MINOR 1 +#define CLIENT_VERSION_MAJOR 2 +#define CLIENT_VERSION_MINOR 0 #define CLIENT_VERSION_REVISION 0 -#define CLIENT_VERSION_BUILD 22 +#define CLIENT_VERSION_BUILD 0 // Converts the parameter X to a string after macro replacement on X has been performed. // Don't merge these into one macro! diff --git a/src/main.cpp b/src/main.cpp index 92b3fe9..11fb7bd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -24,6 +24,7 @@ using namespace boost; // // Global state // +static const bool bCoinYearOnly = false; CCriticalSection cs_setpwalletRegistered; set setpwalletRegistered; @@ -33,6 +34,7 @@ CCriticalSection cs_main; CTxMemPool mempool; unsigned int nTransactionsUpdated = 0; + map mapBlockIndex; set > setStakeSeen; libzerocoin::Params* ZCParams; @@ -41,10 +43,13 @@ CBigNum bnProofOfWorkLimit(~uint256(0) >> 20); // "standard" scrypt target limit CBigNum bnProofOfStakeLimit(~uint256(0) >> 20); CBigNum bnProofOfWorkLimitTestNet(~uint256(0) >> 16); -unsigned int nTargetSpacing = 1 * 60; // 1 minute -unsigned int nStakeMinAge = 12 * 60 * 60; // 12 hours +unsigned int nTargetSpacing = 1 * 60; // 1 minute block spacing (Old Block Spacing) +unsigned int nStakeTargetSpacing = 3 * 60; // 3-minute block spacing (New Block Spacing) +unsigned int nStakeMinAge = 12 * 60 * 60; // 12 hours (Original Minimum Stake Age) +unsigned int nStakeMaxAge = -1; // Unlimited Max Stake Age (Original Maximum Stake Age) +unsigned int nStakeMinAgeV2 = 8 * 60 * 60; // 8 Hour Minimum Stake Age (New Minimum Stake Age) +unsigned int nStakeMaxAgeV2 = -1; //Unlimited Max Stake Age (New Maximum Stake Age) -unsigned int nStakeMaxAge = -1; // unlimited unsigned int nModifierInterval = 10 * 60; // time to elapse before new modifier is computed int nCoinbaseMaturity = 350; @@ -482,6 +487,8 @@ bool CTransaction::CheckTransaction() const const CTxOut& txout = vout[i]; if (txout.IsEmpty() && !IsCoinBase() && !IsCoinStake()) return DoS(100, error("CTransaction::CheckTransaction() : txout empty for user transaction")); + if ((!txout.IsEmpty()) && txout.nValue < MIN_TXOUT_AMOUNT) + return DoS(100, error("CTransaction::CheckTransaction() : txout.nValue below minimum")); if (txout.nValue < 0) return DoS(100, error("CTransaction::CheckTransaction() : txout.nValue negative")); if (txout.nValue > MAX_MONEY) @@ -973,18 +980,21 @@ int64_t GetProofOfWorkReward(int64_t nFees, unsigned int nHeight) { int64_t nSubsidy = 0; -if (nHeight == 1) -{ - nSubsidy = 2000000 * COIN; -} -else if (nHeight < 50000) -{ - nSubsidy = 5000 * COIN; -} -else -{ - nSubsidy = 2500 * COIN; -} + if (nHeight == 1) + + { + nSubsidy = 2000000 * COIN; + } + else if (nHeight < 50000) + + { + nSubsidy = 5000 * COIN; + } + else + + { + nSubsidy = 2500 * COIN; + } if (fDebug && GetBoolArg("-printcreation")) @@ -994,7 +1004,19 @@ else } // miner's coin stake reward based on coin age spent (coin-days) -int64_t GetProofOfStakeReward(int64_t nCoinAge, int64_t nFees) +int64_t GetProofOfStakeReward(int64_t nCoinAge, unsigned int nBits, int64_t nFees, int64_t nTime, bool bCoinYearOnly) +{ + int64_t nSubsidy = 0; + + if ( nTime > VERSION2_SWITCH_TIME ) + nSubsidy = GetProofOfStakeRewardV2(nCoinAge, nBits, nTime, bCoinYearOnly); + else + nSubsidy = GetProofOfStakeRewardV1(nCoinAge, nFees); + + return nSubsidy; +} + +int64_t GetProofOfStakeRewardV1(int64_t nCoinAge, int64_t nFees) { int64_t nSubsidy = nCoinAge * COIN_YEAR_REWARD * 33 / (365 * 33 + 8); @@ -1006,6 +1028,70 @@ int64_t GetProofOfStakeReward(int64_t nCoinAge, int64_t nFees) static const int64_t nTargetTimespan = 16 * 60; // 16 mins +int64_t GetProofOfStakeRewardV2(int64_t nCoinAge, unsigned int nBits, unsigned int nTime, bool bCoinYearOnly) +{ + int64_t nRewardCoinYear, nSubsidyLimit = 1000 * COIN; + + // bool fPrintCreation = GetBoolArg("-printcreation"); + + CBigNum bnRewardCoinYearLimit = COIN_YEAR_REWARDV2; // Base stake mint rate, 111% year interest + CBigNum bnTarget; + bnTarget.SetCompact(nBits); + CBigNum bnTargetLimit = bnProofOfStakeLimit; + bnTargetLimit.SetCompact(bnTargetLimit.GetCompact()); + CBigNum bnLowerBound = 11 * CENT; // Lower interest bound is 11% per year + CBigNum bnUpperBound = bnRewardCoinYearLimit; + while (bnLowerBound + CENT <= bnUpperBound) + { + CBigNum bnMidValue = (bnLowerBound + bnUpperBound) / 2; + // if (fDebug && fPrintCreation ) + // printf("GetProofOfStakeReward() : lower=%"PRI64d" upper=%"PRI64d" mid=%"PRI64d"\n", bnLowerBound.getuint64(), bnUpperBound.getuint64(), bnMidValue.getuint64()); + if (bnMidValue * bnMidValue * bnMidValue * bnMidValue * bnTargetLimit > bnRewardCoinYearLimit * bnRewardCoinYearLimit * bnRewardCoinYearLimit * bnRewardCoinYearLimit * bnTarget) + bnUpperBound = bnMidValue; + else + bnLowerBound = bnMidValue; + } + + nRewardCoinYear = bnUpperBound.getuint64(); + + nRewardCoinYear = min((nRewardCoinYear / CENT) * CENT, COIN_YEAR_REWARDV2); + + if(bCoinYearOnly) + return nRewardCoinYear; + + int64_t nSubsidy = (nCoinAge * 33 * nRewardCoinYear) / (365 * 33 + 8); + + // if (fDebug && fPrintCreation && nSubsidyLimit < nSubsidy) + // printf("GetProofOfStakeReward(): %s is greater than %s, coinstake reward will be truncated\n", FormatMoney(nSubsidy).c_str(), FormatMoney(nSubsidyLimit).c_str()); + + nSubsidy = min(nSubsidy, nSubsidyLimit); + + // if (fDebug && fPrintCreation) + // printf("GetProofOfStakeReward(): create=%s nCoinAge=%"PRI64d" nBits=%d\n", FormatMoney(nSubsidy).c_str(), nCoinAge, nBits); + + return nSubsidy; +} + +unsigned int GetStakeMinAge(unsigned int nTime) +{ + if (nTime > VERSION2_SWITCH_TIME) + return nStakeMinAgeV2; + else + return nStakeMinAge; +} + +unsigned int GetStakeMaxAge(unsigned int nTime) +{ + if (nTime > VERSION2_SWITCH_TIME) + return nStakeMaxAgeV2; + else + return nStakeMaxAge; +} + +static const int64_t nTargetSpacingWorkMax = 12 * nStakeTargetSpacing; // 2-hour + + + // // maximum nBits value could possible be required nTime after // @@ -1617,7 +1703,7 @@ bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex, bool fJustCheck) if (!vtx[1].GetCoinAge(txdb, nCoinAge)) return error("ConnectBlock() : %s unable to get coin age for coinstake", vtx[1].GetHash().ToString().substr(0,10).c_str()); - int64_t nCalculatedStakeReward = GetProofOfStakeReward(nCoinAge, nFees); + int64_t nCalculatedStakeReward = GetProofOfStakeReward(nCoinAge, nBits, nFees, nTime, bCoinYearOnly); if (nStakeReward > nCalculatedStakeReward) return DoS(100, error("ConnectBlock() : coinstake pays too much(actual=%"PRId64" vs calculated=%"PRId64")", nStakeReward, nCalculatedStakeReward)); diff --git a/src/main.h b/src/main.h index db78572..1829a02 100644 --- a/src/main.h +++ b/src/main.h @@ -39,12 +39,15 @@ static const unsigned int MAX_INV_SZ = 50000; static const int64_t MIN_TX_FEE = 10000; static const int64_t MIN_RELAY_TX_FEE = MIN_TX_FEE; static const int64_t MAX_MONEY = 2000000000 * COIN; -static const int64_t COIN_YEAR_REWARD = 2 * CENT; // 1% per year - +static const int64_t COIN_YEAR_REWARD = 2 * CENT; // 2% per year +static const int64_t COIN_YEAR_REWARDV2 = 111 * CENT; // 111% per year +static const unsigned int VERSION2_SWITCH_TIME = 1417392001; // December 1st 2014 @ 00:00:01 +static const int64_t MIN_TXOUT_AMOUNT = MIN_TX_FEE; inline bool MoneyRange(int64_t nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); } // Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp. static const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov 5 00:53:20 1985 UTC + #ifdef USE_UPNP static const int fHaveUPnP = true; #else @@ -94,6 +97,8 @@ extern bool fEnforceCanonical; // Minimum disk space required - used in CheckDiskSpace() static const uint64_t nMinDiskSpace = 52428800; + + class CReserveKey; class CTxDB; class CTxIndex; @@ -115,7 +120,11 @@ bool LoadExternalBlockFile(FILE* fileIn); bool CheckProofOfWork(uint256 hash, unsigned int nBits); unsigned int GetNextTargetRequired(const CBlockIndex* pindexLast, bool fProofOfStake); int64_t GetProofOfWorkReward(int64_t nFees, unsigned int nHeight); -int64_t GetProofOfStakeReward(int64_t nCoinAge, int64_t nFees); +int64_t GetProofOfWorkRewardV2(int64_t nFees, unsigned int nHeight); +int64_t GetProofOfStakeReward(int64_t nCoinAge, unsigned int nBits, int64_t nFees, int64_t nTime, bool bCoinYearOnly=false); +int64_t GetProofOfStakeRewardV1(int64_t nCoinAge, int64_t nFees); +int64_t GetProofOfStakeRewardV2(int64_t nCoinAge, unsigned int nBits, unsigned int nTime, bool bCoinYearOnly=false); + unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime); unsigned int ComputeMinStake(unsigned int nBase, int64_t nTime, unsigned int nBlockTime); int GetNumBlocksOfPeers(); diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp index ef0af1e..08239dc 100644 --- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -3,7 +3,6 @@ #include "bitcoinunits.h" #include "guiconstants.h" -#include "poolbrowser.h" #include #include @@ -89,12 +88,6 @@ void BitcoinAmountField::setValid(bool valid) { } QString BitcoinAmountField::text() const { - - //Avoid putting 'NaN' in BTC price due to divide by zero. Happens when price has not been received from Market Data API - QString qsBtcPrice = _dBtcPriceCurrent > 0 ? (QString::number(amount->value() * (_dScPriceLast / _dBtcPriceCurrent))) : "0"; - - label_btc->setText("Sending $" + (QString::number(amount->value() * _dScPriceLast)) + " or " + qsBtcPrice + " BTC at current market rate"); - if (amount->text().isEmpty()) { return QString(); } else { diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 915df44..c3f3de1 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -23,9 +23,7 @@ #include "addresstablemodel.h" #include "transactionview.h" #include "overviewpage.h" -#include "statisticspage.h" #include "blockbrowser.h" -#include "poolbrowser.h" #include "richlist.h" #include "poll.h" #include "bitcoinunits.h" @@ -115,10 +113,8 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): // Create tabs overviewPage = new OverviewPage(this); - statisticsPage = new StatisticsPage(this); - + blockBrowser = new BlockBrowser(this); - poolBrowser = new PoolBrowser(this); richList = new RichList(this); poll = new Poll(this); @@ -210,9 +206,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); - centralWidget->addWidget(statisticsPage); centralWidget->addWidget(blockBrowser); - centralWidget->addWidget(poolBrowser); centralWidget->addWidget(richList); centralWidget->addWidget(poll); centralWidget->addWidget(transactionsPage); @@ -261,7 +255,6 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): toolbar2->setObjectName("toolbar2"); toolbar2->setFixedWidth(30); toolbar2->setIconSize(QSize(28, 28)); - toolbar2->addAction(actionConvertCurrency); toolbar2->addAction(actionLockUnlockWallet_Toolbar); toolbar2->addWidget(labelStakingIcon); toolbar2->addWidget(labelConnectionsIcon); @@ -317,10 +310,6 @@ void BitcoinGUI::createActions() { overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); tabGroup->addAction(overviewAction); - statisticsAction = new QAction(QIcon(":/icons/statistics"), tr("&Statistics"), this); - statisticsAction->setCheckable(true); - tabGroup->addAction(statisticsAction); - historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this); historyAction->setCheckable(true); historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4)); @@ -342,11 +331,6 @@ void BitcoinGUI::createActions() { blockAction->setCheckable(true); tabGroup->addAction(blockAction); - poolAction = new QAction(QIcon(":/icons/ex"), tr("&Market Data"), this); - poolAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_7)); - poolAction->setCheckable(true); - tabGroup->addAction(poolAction); - richListAction = new QAction(QIcon(":/icons/richlist"), tr("&Rich List"), this); richListAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_R)); richListAction->setCheckable(true); @@ -411,12 +395,10 @@ void BitcoinGUI::createActions() { wId2->hide(); connect(blockAction, SIGNAL(triggered()), this, SLOT(gotoBlockBrowser())); - connect(poolAction, SIGNAL(triggered()), this, SLOT(gotoPoolBrowser())); connect(richListAction, SIGNAL(triggered()), this, SLOT(gotoRichList())); connect(pollAction, SIGNAL(triggered()), this, SLOT(gotoPoll())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); - connect(statisticsAction, SIGNAL(triggered()), this, SLOT(gotoStatisticsPage())); connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); @@ -506,9 +488,7 @@ void BitcoinGUI::createToolBars() { toolbar->addAction(historyAction); toolbar->addAction(addressBookAction); toolbar->addAction(messageAction); - toolbar->addAction(statisticsAction); toolbar->addAction(blockAction); - toolbar->addAction(poolAction); toolbar->addAction(richListAction); toolbar->addAction(pollAction); toolbar->addAction(settingsAction); @@ -594,9 +574,7 @@ void BitcoinGUI::setWalletModel(WalletModel *walletModel) { sendCoinsPage->setModel(walletModel); signVerifyMessageDialog->setModel(walletModel); - statisticsPage->setModel(clientModel); blockBrowser->setModel(clientModel); - poolBrowser->setModel(clientModel); richList->setModel(clientModel); poll->setModel(walletModel); setEncryptionStatus(walletModel->getEncryptionStatus()); @@ -934,35 +912,6 @@ void BitcoinGUI::incomingTransaction(const QModelIndex& parent, int start, int e .arg(type) .arg(address), icon); } - - if (convertmode == 1) { - notificator->notify(Notificator::Information, - (amount) < 0 ? tr("Sent transaction") : - tr("Incoming transaction"), - tr("Date: %1\n" - "Amount: %2\n" - "Type: %3\n" - "Address: %4\n") - .arg(date) - .arg(BitcoinUnits::formatWithUnit(walletModel->getOptionsModel()->getDisplayUnit(), _dScPriceLast * amount, true)) - .arg(type) - .arg(address), icon); - - } - - if (convertmode == 2) { - notificator->notify(Notificator::Information, - (amount) < 0 ? tr("Sent transaction") : - tr("Incoming transaction"), - tr("Date: %1\n" - "Amount: %2\n" - "Type: %3\n" - "Address: %4\n") - .arg(date) - .arg(BitcoinUnits::formatWithUnit(walletModel->getOptionsModel()->getDisplayUnit(), _dScPriceLast / _dBtcPriceCurrent * amount, true)) - .arg(type) - .arg(address), icon); - } } } @@ -1019,25 +968,6 @@ void BitcoinGUI::gotoOverviewPage() { wId2->hide(); } -void BitcoinGUI::gotoPoolBrowser() { - poolAction->setChecked(true); - actionSendReceive->setChecked(false); - - centralWidget->setCurrentWidget(poolBrowser); - - exportAction->setEnabled(false); - actionConvertCurrency->setEnabled(true); - actionConvertCurrency->setVisible(true); - disconnect(actionConvertCurrency, SIGNAL(triggered()), 0, 0); - connect(actionConvertCurrency, SIGNAL(triggered()), this, SLOT(sConvert())); - exportAction->setVisible(false); - - disconnect(exportAction, SIGNAL(triggered()), 0, 0); - - wId->raise(); - wId2->hide(); -} - void BitcoinGUI::gotoRichList() { richListAction->setChecked(true); actionSendReceive->setChecked(false); @@ -1092,24 +1022,6 @@ void BitcoinGUI::gotoBlockBrowser() { wId2->hide(); } -void BitcoinGUI::gotoStatisticsPage() { - statisticsAction->setChecked(true); - actionSendReceive->setChecked(false); - - centralWidget->setCurrentWidget(statisticsPage); - - actionConvertCurrency->setEnabled(true); - actionConvertCurrency->setVisible(true); - disconnect(actionConvertCurrency, SIGNAL(triggered()), 0, 0); - connect(actionConvertCurrency, SIGNAL(triggered()), this, SLOT(sConvert())); - exportAction->setVisible(false); - - exportAction->setEnabled(false); - disconnect(exportAction, SIGNAL(triggered()), 0, 0); - wId->raise(); - wId2->hide(); -} - void BitcoinGUI::gotoHistoryPage() { historyAction->setChecked(true); actionSendReceive->setChecked(false); diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 96d2e73..8f48f69 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -10,9 +10,7 @@ class WalletModel; class MessageModel; class TransactionView; class OverviewPage; -class StatisticsPage; class BlockBrowser; -class PoolBrowser; class RichList; class Poll; class AddressBookPage; @@ -75,9 +73,7 @@ class BitcoinGUI : public QMainWindow { QStackedWidget *centralWidget; OverviewPage *overviewPage; - StatisticsPage *statisticsPage; BlockBrowser *blockBrowser; - PoolBrowser *poolBrowser; RichList *richList; Poll *poll; ChatWindow *chatWindow; @@ -190,9 +186,7 @@ class BitcoinGUI : public QMainWindow { private slots: void gotoOverviewPage(); - void gotoStatisticsPage(); void gotoBlockBrowser(); - void gotoPoolBrowser(); void gotoRichList(); void gotoPoll(); void gotoHistoryPage(); diff --git a/src/qt/forms/poolbrowser.ui b/src/qt/forms/poolbrowser.ui deleted file mode 100644 index 9a02b2c..0000000 --- a/src/qt/forms/poolbrowser.ui +++ /dev/null @@ -1,3331 +0,0 @@ - - - PoolBrowser - - - Qt::NonModal - - - - 0 - 0 - 766 - 509 - - - - Digging - - - - - - - QLayout::SetMaximumSize - - - 0 - - - 0 - - - - - Qt::LeftToRight - - - #All QTabBar::tab {border:none;height:0px;margin-top:0px;padding-top:35px;padding-bottom:25px;padding-right:60px;padding-left:0;margin-left:-20px} QTabWidget::tab-bar {alignment:center;} QTabWidget::pane {border:none;} - - - QTabWidget::West - - - QTabWidget::Rounded - - - 0 - - - - 35 - 144 - - - - Qt::ElideNone - - - - - - - - :/icons/res/icons/over.png:/icons/res/icons/over.png - - - - - - - - 10 - 40 - 601 - 401 - - - - - Calibri - 12 - 75 - true - true - - - - - - - - - -10 - -50 - 681 - 441 - - - - - Myriad Pro - -1 - - - - QWidget {Font-family:Myriad Pro;color:#61696c;font-size:12px;background:#edf1f7;} -#view1_4 {border-left:1px solid grey;} - - - - - 340 - 130 - 111 - 81 - - - - - - 0 - 0 - 101 - 31 - - - - border:none; - - - <html><head/><body><p align="center"><span style=" font-size:12pt;">Cryptsy</span></p></body></html> - - - - - - 10 - 40 - 91 - 16 - - - - 0.00000000 B - - - Qt::AlignCenter - - - - - true - - - - -10 - 60 - 121 - 20 - - - - 0.00% - - - Qt::AlignCenter - - - - - - - 119 - 130 - 111 - 81 - - - - border-right:1px solid #bdc3c7; - - - - - 0 - 0 - 101 - 31 - - - - border:none; - - - <html><head/><body><p align="center"><span style=" font-size:12pt;">Bittrex</span></p></body></html> - - - - - - 10 - 40 - 91 - 16 - - - - border:none; - - - 0.00000000 B - - - Qt::AlignCenter - - - - - true - - - - 0 - 60 - 111 - 20 - - - - 0.00% - - - Qt::AlignCenter - - - - - - - 190 - 295 - 101 - 31 - - - - <html><head/><body><p><span style=" font-weight:600; color:#767676;">Bitcoin Price</span></p></body></html> - - - - - - 310 - 300 - 141 - 21 - - - - $1000.00 - - - - - - 210 - 50 - 161 - 41 - - - - - Mohave - -1 - - - - The simultaneous purchase and sale of an asset in order to profit from a difference in the price. - - - font-family:Mohave; - - - <html><head/><body><p align="center"><span style=" font-size:14pt;">Arbitrage</span></p></body></html> - - - - - - 190 - 270 - 101 - 31 - - - - <html><head/><body><p><span style=" font-weight:600; color:#767676;">Silkcoin Avg</span></p></body></html> - - - - - - 310 - 275 - 141 - 21 - - - - B0.00000000 - - - - - - 30 - 375 - 521 - 41 - - - - Disclaimer: Access to market API's cannot be guaranteed. USD prices for all markets are calculated based BTC/USD price on Coinbase. - - - true - - - - - - 230 - 130 - 111 - 81 - - - - border-right:1px solid #bdc3c7; - - - - - 10 - 40 - 91 - 16 - - - - border:none; - - - 0.00000000 B - - - Qt::AlignCenter - - - - - - 10 - 0 - 91 - 31 - - - - border:none; - - - <html><head/><body><p align="center"><span style=" font-size:12pt;">Poloniex</span></p></body></html> - - - - - true - - - - -10 - 60 - 121 - 20 - - - - 0.00% - - - Qt::AlignCenter - - - - - - - - - - - - - :/icons/res/icons/bittrex.png:/icons/res/icons/bittrex.png - - - - - - - - 10 - 10 - 601 - 431 - - - - - Calibri - 12 - 75 - true - true - - - - false - - - QTabBar:tab {height:20px;background:none;color:white;margin:0px;margin-right:10px;text-align:center;padding:2px;border-radius:3px;font-style:italic;width:80px;font-size:12px;margin-bottom:10px;} -QTabWidget::tab-bar {alignment:right;border:0px;} -QTabBar::tab:last {margin-right:100px;} - - - QTabWidget::North - - - QTabWidget::Rounded - - - 0 - - - - 85 - 20 - - - - true - - - - border:none;background:#edf1f7; - - - - :/icons/res/icons/main.png:/icons/res/icons/main.png - - - - - - - - -10 - -50 - 681 - 441 - - - - - Myriad Pro - -1 - - - - Font-family:Myriad Pro;color:#61696c;font-size:12px; - - - - - 240 - 180 - 111 - 81 - - - - border-right:1px solid #bdc3c7; - - - - - 0 - 0 - 101 - 31 - - - - border:none; - - - <html><head/><body><p align="center"><span style=" font-size:12pt;">Ask</span></p></body></html> - - - - - - 10 - 40 - 91 - 16 - - - - border:none; - - - B0.00000000 - - - Qt::AlignCenter - - - - - - 10 - 60 - 91 - 16 - - - - border:none; - - - $0.00000000 - - - Qt::AlignCenter - - - - - - - 360 - 180 - 111 - 81 - - - - - - 0 - 0 - 101 - 31 - - - - border:none; - - - <html><head/><body><p align="center"><span style=" font-size:12pt;">Bid</span></p></body></html> - - - - - - 10 - 40 - 91 - 16 - - - - B0.00000000 - - - Qt::AlignCenter - - - - - - 10 - 60 - 91 - 16 - - - - $0.00000000 - - - Qt::AlignCenter - - - - - - - 120 - 180 - 111 - 81 - - - - border-right:1px solid #bdc3c7; - - - - - 0 - 0 - 101 - 31 - - - - border:none; - - - <html><head/><body><p align="center"><span style=" font-size:12pt;">Last</span></p></body></html> - - - - - - 10 - 40 - 91 - 16 - - - - border:none; - - - B0.00000000 - - - Qt::AlignCenter - - - - - - 10 - 60 - 91 - 16 - - - - border:none; - - - $0.00000000 - - - Qt::AlignCenter - - - - - - - 230 - 130 - 121 - 31 - - - - font-weight:600;font-size:17px; - - - <html><head/><body><p>0.00%</p></body></html> - - - Qt::AlignCenter - - - - - - 300 - 270 - 271 - 41 - - - - - Myriad Pro - -1 - - - - <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:400; color:#f2594b;">Sell</span></p></body></html> - - - - - - 300 - 310 - 271 - 121 - - - - true - - - QScrollBar:vertical {margin-top:22px;background: #95a5a6;}QScrollBar::handle:vertical {background: #703030;min-width: 10px;min-height:20px;}QScrollBar::add-line:vertical {width: 0px;subcontrol-position: top left;}QScrollBar::sub-line:vertical {width: 0px;subcontrol-position: top left;}QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal {width: 0px;height: 0px;}QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {background: none;} QTreeWidget {background:#d3d6d8;} - QHeaderView::section { - background-color: #f2594b; - padding-left: 15px; - border: 0px; - height:22px; - } - - - - Qt::ScrollBarAlwaysOn - - - 8 - - - 10 - - - true - - - true - - - true - - - true - - - - Price - - - - Raavi - 9 - 75 - false - true - PreferAntialias - true - - - - - 242 - 89 - 75 - - - - - - 255 - 255 - 255 - - - - - - - Quantity - - - - Raavi - 9 - 75 - false - true - PreferAntialias - true - - - - - 242 - 89 - 75 - - - - - - 255 - 255 - 255 - - - - - - - - - 350 - 120 - 71 - 20 - - - - <html><head/><body><p>Volume SC</p></body></html> - - - - - - 440 - 119 - 141 - 21 - - - - 000000.00000000 - - - - - - 350 - 142 - 81 - 16 - - - - <html><head/><body><p>Volume BTC</p></body></html> - - - - - - 440 - 140 - 141 - 21 - - - - 0000.00000000 - - - - - - 350 - 100 - 81 - 20 - - - - <html><head/><body><p>Volume USD</p></body></html> - - - - - - 80 - 100 - 41 - 21 - - - - <html><head/><body><p>High</p></body></html> - - - - - - 440 - 98 - 141 - 21 - - - - 00000.00 - - - - - - 130 - 100 - 91 - 21 - - - - 0.000000000 - - - - - - 80 - 120 - 41 - 21 - - - - <html><head/><body><p>Low</p></body></html> - - - - - - 130 - 120 - 91 - 21 - - - - 0.000000000 - - - - - true - - - - 510 - 310 - 61 - 22 - - - - - 0 - 22 - - - - - 16777215 - 22 - - - - background-color:#f2594b; - - - - - - 30 - 270 - 261 - 41 - - - - - Myriad Pro - -1 - - - - <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:400; color:#7cc576;">Buy</span></p></body></html> - - - - - - 230 - 310 - 61 - 22 - - - - - 0 - 22 - - - - - 16777215 - 22 - - - - background-color:#7cc576; - - - - - - 30 - 310 - 261 - 121 - - - - QScrollBar:vertical {margin-top:22px;background: #95a5a6;}QScrollBar::handle:vertical {background: #4e8e81;max-width: 5px;min-height:20px;}QScrollBar::add-line:vertical {width: 0px;subcontrol-position: top left;}QScrollBar::sub-line:vertical {width: 0px;subcontrol-position: top left;}QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal {width: 0px;height: 0px;}QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {background: none;} QTreeWidget {background:#d3d6d8;} - QHeaderView::section { - background-color: #7cc576; - padding-left: 15px; - border: 0px; - height:22px; - } - - - - Qt::ScrollBarAlwaysOn - - - 10 - - - - Price - - - - Raavi - 75 - true - - - - - 124 - 197 - 118 - - - - - - 255 - 255 - 255 - - - - - - - Quantity - - - - Raavi - 9 - 75 - true - - - - - 124 - 197 - 118 - - - - - - 255 - 255 - 255 - - - - - - - - - 210 - 50 - 161 - 41 - - - - - Mohave - -1 - - - - font-family:Mohave; - - - <html><head/><body><p align="center"><span style=" font-size:14pt;">Bittrex</span></p></body></html> - - - - - - 240 - 110 - 101 - 21 - - - - <html><head/><body><p align="center"><span style=" font-size:9pt; font-weight:600;">Change</span></p></body></html> - - - - - - 130 - 140 - 91 - 21 - - - - 0.000000000 - - - - - - 80 - 140 - 41 - 21 - - - - <html><head/><body><p>Close</p></body></html> - - - - - - 110 - 80 - 361 - 20 - - - - <html><head/><body><p><a href="https://bittrex.com/Market/?MarketName=BTC-SC"><span style=" text-decoration: underline; color:#0000ff;">Market Link</span></a></p></body></html> - - - Qt::AlignCenter - - - qWidgetBittrexAsk - qWidgetBittrexBid - qWidgetBittrexLast - lblBittrexChangePerc - lblBittrexSellHeader - qTreeWidgetBittrexSell - lblBittrexVolumeScHeader - lblBittrexVolumeSc - lblBittrexVolumeBtcHeader - lblBittrexVolumeBtc - lblBittrexVolumeUsdHeader - lblBittrexHigh - lblBittrexVolumeUsd - lblBittrexHighBtc - lblBittrexLow - lblBittrexLowBtc - lblBittrexBuyHeader - qTreeWidgetBittrexBuy - lblBittrexHeader - lblBittrexChange - imgBittrexSell - imgBittrexBuy - lblBittrexCloseBtc - lblBittrexClose - lblBittrexMarketLink - - - - - background:#edf1f7; - - - - :/icons/res/icons/graph.png:/icons/res/icons/graph.png - - - - - - - - 0 - 0 - 620 - 391 - - - - Font-family:Myriad Pro;color:#61696c;font-size:12px; - - - - - 10 - 0 - 541 - 381 - - - - QScrollBar:horizontal {background: white;height: 15px;margin: 0px 0px 0 0px;}QScrollBar::handle:horizontal {background: #95a5a6;min-width: 20px;}QScrollBar::add-line:horizontal {width: 0px;subcontrol-position: top right;}QScrollBar::sub-line:horizontal {width: 0px;subcontrol-position: top right;}QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal {width: 0px;height: 0px;}QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {background: none;} - - - QFrame::NoFrame - - - QFrame::Plain - - - Qt::ScrollBarAlwaysOn - - - true - - - - - 0 - 0 - 1635 - 366 - - - - - 1635 - 0 - - - - - - - - - 0 - 330 - 311 - 21 - - - - <html><head/><body><p><span style=" font-weight:600;">Price chart, </span>last 50 trades - Satoshi/trade</p></body></html> - - - - - - 0 - 10 - 531 - 311 - - - - background:#edf1f7 - - - - - - 550 - 10 - 531 - 311 - - - - background:#edf1f7 - - - - - - 600 - 330 - 211 - 20 - - - - <html><head/><body><p><span style=" font-weight:600;">Order depth </span>- Volume/Satoshi</p></body></html> - - - - - - 1100 - 10 - 521 - 331 - - - - QScrollBar:vertical {background: white;height: 15px;}QScrollBar::handle:vertical {background: #d3d6d8;min-width: 20px;} - - - Qt::ScrollBarAlwaysOn - - - Qt::ScrollBarAlwaysOff - - - 16 - - - 10 - - - true - - - false - - - false - - - false - - - false - - - - Type - - - - - Price - - - - - Quantity - - - - - Total - - - - - Time - - - - - - - - - - - - - - - - :/icons/poloniex:/icons/poloniex - - - - - - - - 10 - 10 - 601 - 431 - - - - - Calibri - 12 - 75 - true - true - - - - false - - - QTabBar:tab {height:20px;background:none;color:white;margin:0px;margin-right:10px;text-align:center;padding:2px;border-radius:3px;font-style:italic;width:80px;font-size:12px;margin-bottom:10px;} -QTabWidget::tab-bar {alignment:right;border:0px;} -QTabBar::tab:last {margin-right:100px;} - - - QTabWidget::North - - - QTabWidget::Rounded - - - 0 - - - - 85 - 20 - - - - true - - - - border:none;background:#edf1f7; - - - - :/icons/res/icons/main.png:/icons/res/icons/main.png - - - - - - - - -10 - -50 - 681 - 441 - - - - - Myriad Pro - -1 - - - - Font-family:Myriad Pro;color:#61696c;font-size:12px; - - - - - 240 - 180 - 111 - 81 - - - - border-right:1px solid #bdc3c7; - - - - - 0 - 0 - 101 - 31 - - - - border:none; - - - <html><head/><body><p align="center"><span style=" font-size:12pt;">Ask</span></p></body></html> - - - - - - 10 - 40 - 91 - 16 - - - - border:none; - - - B0.00000000 - - - Qt::AlignCenter - - - - - - 10 - 60 - 91 - 16 - - - - border:none; - - - $0.00000000 - - - Qt::AlignCenter - - - - - - - 360 - 180 - 111 - 81 - - - - - - 0 - 0 - 101 - 31 - - - - border:none; - - - <html><head/><body><p align="center"><span style=" font-size:12pt;">Bid</span></p></body></html> - - - - - - 10 - 40 - 91 - 16 - - - - B0.00000000 - - - Qt::AlignCenter - - - - - - 10 - 60 - 91 - 16 - - - - $0.00000000 - - - Qt::AlignCenter - - - - - - - 120 - 180 - 111 - 81 - - - - border-right:1px solid #bdc3c7; - - - - - 0 - 0 - 101 - 31 - - - - border:none; - - - <html><head/><body><p align="center"><span style=" font-size:12pt;">Last</span></p></body></html> - - - - - - 10 - 40 - 91 - 16 - - - - border:none; - - - B0.00000000 - - - Qt::AlignCenter - - - - - - 10 - 60 - 91 - 16 - - - - border:none; - - - $0.00000000 - - - Qt::AlignCenter - - - - - - - 230 - 130 - 121 - 31 - - - - font-weight:600;font-size:17px; - - - <html><head/><body><p>0.00%</p></body></html> - - - Qt::AlignCenter - - - - - - 300 - 270 - 271 - 41 - - - - - Myriad Pro - -1 - - - - <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:400; color:#f2594b;">Sell</span></p></body></html> - - - - - - 300 - 310 - 271 - 121 - - - - true - - - QScrollBar:vertical {margin-top:22px;background: #95a5a6;}QScrollBar::handle:vertical {background: #703030;min-width: 10px;min-height:20px;}QScrollBar::add-line:vertical {width: 0px;subcontrol-position: top left;}QScrollBar::sub-line:vertical {width: 0px;subcontrol-position: top left;}QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal {width: 0px;height: 0px;}QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {background: none;} QTreeWidget {background:#d3d6d8;} - QHeaderView::section { - background-color: #f2594b; - padding-left: 15px; - border: 0px; - height:22px; - } - - - - Qt::ScrollBarAlwaysOn - - - 8 - - - 10 - - - true - - - true - - - true - - - true - - - - Price - - - - Raavi - 9 - 75 - false - true - PreferAntialias - true - - - - - 242 - 89 - 75 - - - - - - 255 - 255 - 255 - - - - - - - Quantity - - - - Raavi - 9 - 75 - false - true - PreferAntialias - true - - - - - 242 - 89 - 75 - - - - - - 255 - 255 - 255 - - - - - - - - - 350 - 120 - 71 - 20 - - - - <html><head/><body><p>Volume SC</p></body></html> - - - - - - 440 - 119 - 141 - 21 - - - - 000000.00000000 - - - - - - 350 - 142 - 81 - 16 - - - - <html><head/><body><p>Volume BTC</p></body></html> - - - - - - 440 - 140 - 141 - 21 - - - - 0000.00000000 - - - - - - 350 - 100 - 81 - 20 - - - - <html><head/><body><p>Volume USD</p></body></html> - - - - - - 440 - 98 - 141 - 21 - - - - 00000.00 - - - - - true - - - - 510 - 310 - 61 - 22 - - - - - 0 - 22 - - - - - 16777215 - 22 - - - - background-color:#f2594b; - - - - - - 30 - 270 - 261 - 41 - - - - - Myriad Pro - -1 - - - - <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:400; color:#7cc576;">Buy</span></p></body></html> - - - - - - 230 - 310 - 61 - 22 - - - - - 0 - 22 - - - - - 16777215 - 22 - - - - background-color:#7cc576; - - - - - - 30 - 310 - 261 - 121 - - - - QScrollBar:vertical {margin-top:22px;background: #95a5a6;}QScrollBar::handle:vertical {background: #4e8e81;max-width: 5px;min-height:20px;}QScrollBar::add-line:vertical {width: 0px;subcontrol-position: top left;}QScrollBar::sub-line:vertical {width: 0px;subcontrol-position: top left;}QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal {width: 0px;height: 0px;}QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {background: none;} QTreeWidget {background:#d3d6d8;} - QHeaderView::section { - background-color: #7cc576; - padding-left: 15px; - border: 0px; - height:22px; - } - - - - Qt::ScrollBarAlwaysOn - - - 10 - - - - Price - - - - Raavi - 75 - true - - - - - 124 - 197 - 118 - - - - - - 255 - 255 - 255 - - - - - - - Quantity - - - - Raavi - 9 - 75 - true - - - - - 124 - 197 - 118 - - - - - - 255 - 255 - 255 - - - - - - - - - 210 - 50 - 161 - 41 - - - - - Mohave - -1 - - - - font-family:Mohave; - - - <html><head/><body><p align="center"><span style=" font-size:14pt;">Poloniex</span></p></body></html> - - - - - - 240 - 110 - 101 - 21 - - - - <html><head/><body><p align="center"><span style=" font-size:9pt; font-weight:600;">Change</span></p></body></html> - - - - - - 110 - 80 - 361 - 20 - - - - <html><head/><body><p><a href="https://poloniex.com/exchange/btc_silk"><span style=" text-decoration: underline; color:#0000ff;">Market Link</span></a></p></body></html> - - - Qt::AlignCenter - - - - - - 80 - 120 - 31 - 21 - - - - <html><head/><body><p>Low</p></body></html> - - - - - - 130 - 140 - 91 - 21 - - - - 0.000000000 - - - - - - 130 - 120 - 91 - 21 - - - - 0.000000000 - - - - - - 80 - 100 - 31 - 21 - - - - <html><head/><body><p>High</p></body></html> - - - - - - 130 - 100 - 91 - 21 - - - - 0.000000000 - - - - - - 80 - 140 - 41 - 21 - - - - <html><head/><body><p>Close</p></body></html> - - - qWidgetPoloniexAsk - qWidgetPoloniexBid - qWidgetPoloniexLast - lblPoloniexChangePerc - lblPoloniexSellHeader - qTreeWidgetPoloniexSell - lblPoloniexVolumeScHeader - lblPoloniexVolumeSc - lblPoloniexVolumeBtcHeader - lblPoloniexVolumeBtc - lblPoloniexVolumeUsdHeader - lblPoloniexVolumeUsd - lblPoloniexBuyHeader - qTreeWidgetPoloniexBuy - lblPoloniexHeader - lblPoloniexChange - imgPoloniexSell - imgPoloniexBuy - lblPoloniexMarketLink - lblPoloniexLow - lblPoloniexCloseBtc - lblPoloniexLowBtc - lblPoloniexHigh - lblPoloniexHighBtc - lblPoloniexClose - - - - - background:#edf1f7; - - - - :/icons/res/icons/graph.png:/icons/res/icons/graph.png - - - - - - - - 0 - 0 - 620 - 391 - - - - Font-family:Myriad Pro;color:#61696c;font-size:12px; - - - - - 10 - 0 - 541 - 381 - - - - QScrollBar:horizontal {background: white;height: 15px;margin: 0px 0px 0 0px;}QScrollBar::handle:horizontal {background: #95a5a6;min-width: 20px;}QScrollBar::add-line:horizontal {width: 0px;subcontrol-position: top right;}QScrollBar::sub-line:horizontal {width: 0px;subcontrol-position: top right;}QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal {width: 0px;height: 0px;}QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {background: none;} - - - QFrame::NoFrame - - - QFrame::Plain - - - Qt::ScrollBarAlwaysOn - - - true - - - - - 0 - 0 - 1635 - 366 - - - - - 1635 - 0 - - - - - - - - - 0 - 330 - 311 - 21 - - - - <html><head/><body><p><span style=" font-weight:600;">Price chart, </span>last 50 trades - Satoshi/trade</p></body></html> - - - - - - 0 - 10 - 531 - 311 - - - - background:#edf1f7 - - - - - - 550 - 10 - 531 - 311 - - - - background:#edf1f7 - - - - - - 600 - 330 - 211 - 20 - - - - <html><head/><body><p><span style=" font-weight:600;">Order depth </span>- Volume/Satoshi</p></body></html> - - - - - - 1100 - 10 - 521 - 331 - - - - QScrollBar:vertical {background: white;height: 15px;}QScrollBar::handle:vertical {background: #d3d6d8;min-width: 20px;} - - - Qt::ScrollBarAlwaysOn - - - Qt::ScrollBarAlwaysOff - - - 16 - - - 10 - - - true - - - false - - - false - - - false - - - false - - - - Type - - - - - Price - - - - - Quantity - - - - - Total - - - - - Time - - - - - - - - - - - - - :/icons/res/icons/cryptsy.png:/icons/res/icons/cryptsy.png - - - - - - - - 10 - 10 - 601 - 431 - - - - - Calibri - 12 - 75 - true - true - - - - false - - - QTabBar:tab {height:20px;background:none;color:white;margin:0px;margin-right:10px;text-align:center;padding:2px;border-radius:3px;font-style:italic;width:80px;font-size:14px;margin-bottom:10px;} -QTabWidget::tab-bar {alignment:right;border:0px;} -QTabBar::tab:last {margin-right:100px;} - - - QTabWidget::North - - - QTabWidget::Rounded - - - 0 - - - - 85 - 20 - - - - true - - - - border:none;background:#edf1f7; - - - - :/icons/res/icons/main.png:/icons/res/icons/main.png - - - - - - - - -10 - -50 - 681 - 441 - - - - - Myriad Pro - -1 - - - - Font-family:Myriad Pro;color:#61696c;font-size:12px; - - - - - 240 - 180 - 111 - 81 - - - - border-right:1px solid #bdc3c7; -border-left:1px solid #bdc3c7; - - - - - 10 - 60 - 91 - 16 - - - - border:none; - - - $0.00000000 - - - Qt::AlignCenter - - - - - - 10 - 0 - 91 - 31 - - - - border:none; - - - <html><head/><body><p align="center"><span style=" font-size:12pt;">Last</span></p></body></html> - - - - - - 10 - 40 - 91 - 16 - - - - border:none; - - - B0.00000000 - - - Qt::AlignCenter - - - - - - - 300 - 270 - 271 - 41 - - - - - Myriad Pro - -1 - - - - <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:400; color:#f2594b;">Sell</span></p></body></html> - - - - - - 300 - 310 - 271 - 121 - - - - true - - - QScrollBar:vertical {margin-top:22px;background: #95a5a6;}QScrollBar::handle:vertical {background: #703030;min-width: 10px;min-height:20px;}QScrollBar::add-line:vertical {width: 0px;subcontrol-position: top left;}QScrollBar::sub-line:vertical {width: 0px;subcontrol-position: top left;}QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal {width: 0px;height: 0px;}QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {background: none;} QTreeWidget {background:#d3d6d8;} - QHeaderView::section { - background-color: #f2594b; - padding-left: 15px; - border: 0px; - height:22px; - } - - - - Qt::ScrollBarAlwaysOn - - - 8 - - - 10 - - - true - - - true - - - true - - - true - - - - Price - - - - Raavi - 9 - 75 - false - true - PreferAntialias - true - - - - - 242 - 89 - 75 - - - - - - 255 - 255 - 255 - - - - - - - Quantity - - - - Raavi - 9 - 75 - false - true - PreferAntialias - true - - - - - 242 - 89 - 75 - - - - - - 255 - 255 - 255 - - - - - - - - - 250 - 110 - 81 - 21 - - - - <html><head/><body><p align="center">Volume BTC</p></body></html> - - - - - - 230 - 130 - 121 - 20 - - - - 00000.00000000 - - - Qt::AlignCenter - - - - - - 510 - 310 - 61 - 22 - - - - - 0 - 22 - - - - - 16777215 - 22 - - - - background-color:#f2594b; - - - - - - 30 - 270 - 261 - 41 - - - - - Myriad Pro - -1 - - - - <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:400; color:#7cc576;">Buy</span></p></body></html> - - - - - - 230 - 310 - 61 - 22 - - - - - 0 - 22 - - - - - 16777215 - 22 - - - - background-color:#7cc576; - - - - - - 30 - 310 - 261 - 121 - - - - QScrollBar:vertical {margin-top:22px;background: #95a5a6;}QScrollBar::handle:vertical {background: #4e8e81;max-width: 5px;min-height:20px;}QScrollBar::add-line:vertical {width: 0px;subcontrol-position: top left;}QScrollBar::sub-line:vertical {width: 0px;subcontrol-position: top left;}QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal {width: 0px;height: 0px;}QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {background: none;} QTreeWidget {background:#d3d6d8;} - QHeaderView::section { - background-color: #7cc576; - padding-left: 15px; - border: 0px; - height:22px; - } - - - - Qt::ScrollBarAlwaysOn - - - 8 - - - 10 - - - true - - - true - - - - Price - - - - Raavi - 75 - true - - - - - 124 - 197 - 118 - - - - - - 255 - 255 - 255 - - - - - - - Quantity - - - - Raavi - 9 - 75 - true - - - - - 124 - 197 - 118 - - - - - - 255 - 255 - 255 - - - - - - - - - 210 - 50 - 161 - 41 - - - - - Mohave - -1 - - - - font-family:Mohave; - - - <html><head/><body><p align="center"><span style=" font-size:14pt;">Cryptsy</span></p></body></html> - - - - - - 80 - 180 - 101 - 16 - - - - border:none - - - 0000.00 - - - Qt::AlignCenter - - - - - - 90 - 160 - 81 - 16 - - - - border:none; - - - <html><head/><body><p>Volume USD</p></body></html> - - - - - - 400 - 180 - 131 - 16 - - - - 0000 - - - Qt::AlignCenter - - - - - - 430 - 160 - 71 - 21 - - - - <html><head/><body><p>Volume SC</p></body></html> - - - - - - 110 - 80 - 361 - 20 - - - - <html><head/><body><p><a href="https://www.cryptsy.com/markets/view/225"><span style=" text-decoration: underline; color:#0000ff;">Market Link</span></a></p></body></html> - - - Qt::AlignCenter - - - qWidgetCryptsyLast - lblCryptsySellHeader - qTreeWidgetCryptsySell - lblCryptsyVolumeBtcHeader - lblCryptsyVolumeBtc - imgCryptsySell - lblCryptsyBuyHeader - qTreeWidgetCryptsyBuy - lblCryptsyHeader - lblCryptsyVolumeUsd - lblCryptsyVolumeUsdHeader - lblCryptsyVolumeSc - lblCryptsyVolumeScHeader - imgCryptsyBuy - lblCryptsyMarketLink - - - - - background:#edf1f7; - - - - :/icons/res/icons/graph.png:/icons/res/icons/graph.png - - - - - - - - 0 - 0 - 620 - 391 - - - - Font-family:Myriad Pro;color:#61696c;font-size:12px; - - - - - 10 - 0 - 541 - 381 - - - - QScrollBar:horizontal {background: white;height: 15px;margin: 0px 0px 0 0px;}QScrollBar::handle:horizontal {background: #95a5a6;min-width: 20px;}QScrollBar::add-line:horizontal {width: 0px;subcontrol-position: top right;}QScrollBar::sub-line:horizontal {width: 0px;subcontrol-position: top right;}QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal {width: 0px;height: 0px;}QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {background: none;} - - - QFrame::NoFrame - - - QFrame::Plain - - - Qt::ScrollBarAlwaysOn - - - true - - - - - 0 - 0 - 1635 - 366 - - - - - 1635 - 0 - - - - - - - - - 0 - 330 - 291 - 21 - - - - <html><head/><body><p><span style=" font-weight:600;">Price chart, </span>last 50 trades - Satoshi/trade</p></body></html> - - - - - - 0 - 10 - 531 - 311 - - - - background:#edf1f7 - - - - - - 550 - 10 - 531 - 311 - - - - background:#edf1f7 - - - - - - 600 - 330 - 211 - 20 - - - - <html><head/><body><p><span style=" font-weight:600;">Order depth </span>- Volume/Satoshi</p></body></html> - - - - - - 1100 - 10 - 521 - 331 - - - - QScrollBar:vertical {background: white;height: 15px;}QScrollBar::handle:vertical {background: #d3d6d8;min-width: 20px;} - - - Qt::ScrollBarAlwaysOn - - - Qt::ScrollBarAlwaysOff - - - 16 - - - 10 - - - true - - - false - - - false - - - false - - - false - - - - Type - - - - - Price - - - - - Quantity - - - - - Total - - - - - Time - - - - - - - - - - - - - - - - 0 - 43 - - - - - - 520 - 0 - 191 - 41 - - - - - 0 - 0 - - - - - calibri - -1 - 75 - true - true - - - - background:#34495e;color:white;margin:0px;text-align:center;padding:2px;border-radius:3px;font-style:italic;width:100px;font-size:14px;font-family:calibri;font-weight:600; - - - - - - - :/icons/res/icons/update.png:/icons/res/icons/update.png - - - - 150 - 35 - - - - - - - 30 - 10 - 131 - 20 - - - - <html><head/><body><p><span style=" font-weight:600; color:#767676;">Convert Silkcoin :</span></p></body></html> - - - - - - 160 - 10 - 100 - 23 - - - - - 100 - 23 - - - - - 100 - 16777215 - - - - border: 1px solid #61696c;margin-left:4px; - - - - - - 260 - 10 - 51 - 23 - - - - - 0 - 23 - - - - border:1px solid #61696c;background:white;font-weight:600; - - - = - - - - - - 330 - 0 - 201 - 41 - - - - color:#61696c; - - - $0.0000 / B0.00000000 - - - - - - 680 - 0 - 21 - 41 - - - - One or more markets have failed to respond to API requests - - - <html><head/><body><p><img src=":/icons/transaction_2"/></p></body></html> - - - - - - - - - - QCustomPlot - QWidget -
qcustomplot.h
- 1 -
-
- - - - -
diff --git a/src/qt/forms/statisticspage.ui b/src/qt/forms/statisticspage.ui deleted file mode 100644 index 0816842..0000000 --- a/src/qt/forms/statisticspage.ui +++ /dev/null @@ -1,314 +0,0 @@ - - - StatisticsPage - - - Qt::NonModal - - - - 0 - 0 - 681 - 505 - - - - Digging - - - color:#505050; -font-family:'Proxima Nova Rg'; - - - - QLayout::SetMaximumSize - - - 52 - - - 22 - - - - - - - - QFormLayout::FieldsStayAtSizeHint - - - 78 - - - 18 - - - 0 - - - - - <html><head/><body><p>Block Height</p></body></html> - - - - - - - 00000 - - - - - - - <html><head/><body><p>POS difficulty</p></body></html> - - - - - - - 0.0002 - - - - - - - - 0 - 0 - - - - <html><head/><body><p>Last block time</p></body></html> - - - - - - - 0 KH/s - - - - - - - <html><head/><body><p>Connections</p></body></html> - - - - - - - 0 - - - - - - - <html><head/><body><p>Total Supply</p></body></html> - - - - - - - 250 - - - - - - - <html><head/><body><p>Your stake weight</p></body></html> - - - - - - - 0 - - - - - - - <html><head/><body><p>Network stake weight</p></body></html> - - - - - - - 0 - - - - - - - <html><head/><body><p>Market Cap</p></body></html> - - - - - - - 0$ - - - - - - - - - - - - - - <html><head/><body><p align="center"><img src=":/icons/res/icons/statisticst.png"/></p></body></html> - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 40 - - - - - - - - Qt::Vertical - - - - 20 - 10 - - - - - - - - - 260 - 0 - - - - - - 60 - 259 - 151 - 51 - - - - - 0 - 0 - - - - - 120 - 40 - - - - background:none;border:1px solid grey - - - Update Statistics - - - - - - 20 - 0 - 231 - 191 - - - - <html><head/><body><p align="center"><span style=" font-size:12pt; text-decoration: underline;">Silkcoin phases:</span><br/></p><p align="center">1) Block 1 to 10k - POW/POS</p><p align="center">2) Block 10k to 50k - Full POS</p><p align="center">3) Block 50k to 60k - POW/POS</p><p align="center">4) Block 60k+, full POS<br/></p><p align="center"><span style=" font-size:12pt; text-decoration: underline;">Current Phase:</span></p></body></html> - - - - - - 60 - 220 - 151 - 23 - - - - 24 - - - false - - - - - - 90 - 200 - 91 - 20 - - - - <html><head/><body><p align="center">(1) POW - POS</p></body></html> - - - - - - - - - - diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 8b2f8d4..903c595 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -8,7 +8,6 @@ #include "transactionfilterproxy.h" #include "guiutil.h" #include "guiconstants.h" -#include "poolbrowser.h" #include "bitcoingui.h" #include @@ -71,14 +70,6 @@ class TxViewDelegate : public QAbstractItemDelegate { amountText = BitcoinUnits::formatWithUnit(unit, amount, true); } - if (convertmode == 1) { - amountText = BitcoinUnits::formatWithUnit(unit, (_dScPriceLast * amount), true); - } - - if (convertmode == 2) { - amountText = BitcoinUnits::formatWithUnit(unit, (_dScPriceLast / _dBtcPriceLast * amount), true); - } - if (!confirmed) { amountText = QString("[") + amountText + QString("]"); } @@ -151,19 +142,7 @@ void OverviewPage::setBalance(qint64 balance, qint64 stake, qint64 unconfirmedBa ui->lblBalanceSlot1->setText(BitcoinUnits::formatWithUnit(unit, stake)); ui->lblDetailsSlot0->setText(BitcoinUnits::formatWithUnit(unit, unconfirmedBalance)); ui->lblBalanceSlot3->setText(BitcoinUnits::formatWithUnit(unit, balance + stake + unconfirmedBalance + immatureBalance)); - - } else if (convertmode == 1) { - ui->lblBalanceSlot0->setText(BitcoinUnits::formatWithUnit(unit, (_dScPriceLast * balance))); - ui->lblBalanceSlot1->setText(BitcoinUnits::formatWithUnit(unit, (_dScPriceLast * stake))); - ui->lblDetailsSlot0->setText(BitcoinUnits::formatWithUnit(unit, (_dScPriceLast * unconfirmedBalance))); - ui->lblBalanceSlot3->setText(BitcoinUnits::formatWithUnit(unit, (_dScPriceLast * (balance + stake + unconfirmedBalance + immatureBalance)))); - - } else if (convertmode == 2) { - ui->lblBalanceSlot0->setText(BitcoinUnits::formatWithUnit(unit, (_dScPriceLast / _dBtcPriceLast * balance))); - ui->lblBalanceSlot1->setText(BitcoinUnits::formatWithUnit(unit, (_dScPriceLast / _dBtcPriceLast * stake))); - ui->lblDetailsSlot0->setText(BitcoinUnits::formatWithUnit(unit, (_dScPriceLast / _dBtcPriceLast * unconfirmedBalance))); - ui->lblBalanceSlot3->setText(BitcoinUnits::formatWithUnit(unit, (_dScPriceLast / _dBtcPriceLast * (balance + stake + unconfirmedBalance + immatureBalance)))); - } + } } void OverviewPage::setNumTransactions(int count) { diff --git a/src/qt/poolbrowser.cpp b/src/qt/poolbrowser.cpp deleted file mode 100644 index efec350..0000000 --- a/src/qt/poolbrowser.cpp +++ /dev/null @@ -1,1220 +0,0 @@ -#include "poolbrowser.h" -#include "ui_poolbrowser.h" -#include "main.h" -#include "wallet.h" -#include "base58.h" -#include "clientmodel.h" -#include "bitcoinrpc.h" - -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace json_spirit; - -//Coinbase API -const QString apiCoinbasePrice = "http://api.silkcoin.io/coinbase/exchange_rates.php"; - -//Bittrex API -const QString apiBittrexMarketSummary = "http://api.silkcoin.io/bittrex/market.php"; -const QString apiBittrexTrades = "http://api.silkcoin.io/bittrex/trades.php"; -const QString apiBittrexOrders = "http://api.silkcoin.io/bittrex/orders.php"; - -//Poloniex API -const QString apiPoloniexMarketSummary = "http://api.silkcoin.io/poloniex/market.php"; -const QString apiPoloniex24hVolume = "http://api.silkcoin.io/poloniex/chartdata.php"; -const QString apiPoloniexTrades = "http://api.silkcoin.io/poloniex/trades.php"; -const QString apiPoloniexOrders = "http://api.silkcoin.io/poloniex/orders.php"; - -//Cryptsy API -const QString apiCryptsyTrades = "http://api.silkcoin.io/cryptsy/trades.php"; -const QString apiCryptsyOrders = "http://api.silkcoin.io/cryptsy/orders.php"; - -//Common Globals -double _dScPriceLast = 0; -double _dBtcPriceCurrent = 0; -double _dBtcPriceLast = 0; - -//Bittrex Globals -BittrexMarketSummary* _bittrexMarketSummary = new BittrexMarketSummary(); -BittrexTrades* _bittrexTrades = new BittrexTrades(); -BittrexOrders* _bittrexOrders = new BittrexOrders(); - -//Poloniex Globals -PoloniexMarketSummary* _poloniexMarketSummary = new PoloniexMarketSummary(); -Poloniex24hVolume* _poloninex24hVolume = new Poloniex24hVolume(); -PoloniexTrades* _poloniexTrades = new PoloniexTrades(); -PoloniexOrders* _poloniexOrders = new PoloniexOrders(); - -//Cryptsy Globals -CryptsyTrades* _cryptsyTrades = new CryptsyTrades(); -CryptsyOrders* _cryptsyOrders = new CryptsyOrders(); - -PoolBrowser::PoolBrowser(QWidget* parent) : QWidget(parent), ui(new Ui::PoolBrowser) { - //TODO: Complete multi-threading so we don't have to call this as a primer - getRequest(apiCoinbasePrice); - - ui->setupUi(this); - setFixedSize(400, 420); - - ui->qCustomPlotBittrexTrades->addGraph(); - ui->qCustomPlotBittrexTrades->setBackground(QBrush(QColor("#edf1f7"))); - - ui->qCustomPlotBittrexOrderDepth->addGraph(); - ui->qCustomPlotBittrexOrderDepth->addGraph(); - ui->qCustomPlotBittrexOrderDepth->setBackground(QBrush(QColor("#edf1f7"))); - - ui->qCustomPlotPoloniexTrades->addGraph(); - ui->qCustomPlotPoloniexTrades->setBackground(QBrush(QColor("#edf1f7"))); - - ui->qCustomPlotPoloniexOrderDepth->addGraph(); - ui->qCustomPlotPoloniexOrderDepth->addGraph(); - ui->qCustomPlotPoloniexOrderDepth->setBackground(QBrush(QColor("#edf1f7"))); - - ui->qCustomPlotCryptsyTrades->addGraph(); - ui->qCustomPlotCryptsyTrades->setBackground(QBrush(QColor("#edf1f7"))); - - ui->qCustomPlotCryptsyOrderDepth->addGraph(); - ui->qCustomPlotCryptsyOrderDepth->addGraph(); - ui->qCustomPlotCryptsyOrderDepth->setBackground(QBrush(QColor("#edf1f7"))); - - QObject::connect(&m_nam, SIGNAL(finished(QNetworkReply*)), this, SLOT(parseNetworkResponse(QNetworkReply*)), Qt::AutoConnection); - - //One time primer - pollAPIs(); -} - -void PoolBrowser::on_btnConvertSilkoin_clicked() { - double silkcoinQty = ui->txtConvertSilkcoinQty->text().toDouble(); - double totalBtc = _bittrexMarketSummary->getLastCurrent(double()) * silkcoinQty; - double totalUsd = totalBtc * _dBtcPriceCurrent; - - ui->lblConvertSilkcoinResults->setText("$" + QString::number(totalUsd, 'f', 2) + - " / B" + QString::number(totalBtc, 'f', 8)); - -} -void PoolBrowser::on_btnUpdateMarketData_clicked() { - pollAPIs(); -} - -void PoolBrowser::on_lblBittrexMarketLink_linkActivated(const QString &link) { - QDesktopServices::openUrl(QUrl(link)); -} -void PoolBrowser::on_lblPoloniexMarketLink_linkActivated(const QString &link) { - QDesktopServices::openUrl(QUrl(link)); -} -void PoolBrowser::on_lblCryptsyMarketLink_linkActivated(const QString &link) { - QDesktopServices::openUrl(QUrl(link)); -} - -void PoolBrowser::pollAPIs() { - ui->iconOverviewUpdateWait->setVisible(true); - - getRequest(apiCoinbasePrice); - - getRequest(apiBittrexMarketSummary); - getRequest(apiBittrexTrades); - getRequest(apiBittrexOrders); - - getRequest(apiPoloniexMarketSummary); - getRequest(apiPoloniex24hVolume); - getRequest(apiPoloniexTrades); - getRequest(apiPoloniexOrders); - - getRequest(apiCryptsyTrades); - getRequest(apiCryptsyOrders); -} - -void PoolBrowser::processOverview() { - double averageBittrexCurrent = _bittrexMarketSummary->getLastCurrent(double()) > 0 ? _bittrexMarketSummary->getLastCurrent(double()) : 0.00000001; - double averagePoloniexCurrent = _poloniexMarketSummary->getLastCurrent(double()) > 0 ? _poloniexMarketSummary->getLastCurrent(double()) : 0.00000001; - double averageCryptsyCurrent = _cryptsyTrades->getLastCurrent(double()) > 0 ? _cryptsyTrades->getLastCurrent(double()) : 0.00000001; - double averageAllCurrent = (averageBittrexCurrent + averageCryptsyCurrent + averagePoloniexCurrent) / 3; - - double averageBittrexLast = _bittrexMarketSummary->getLastPrev(double()) > 0 ? _bittrexMarketSummary->getLastPrev(double()) : 0.00000001; - double averagePoloniexLast = _poloniexMarketSummary->getLastPrev(double()) > 0 ? _poloniexMarketSummary->getLastPrev(double()) : 0.00000001; - double averageCryptsyLast = _cryptsyTrades->getLastPrev(double()) > 0 ? _cryptsyTrades->getLastPrev(double()) : 0.00000001; - - double averageAllLast = (averageBittrexLast + averageCryptsyLast + averagePoloniexLast) / 3; - - updateLabel(ui->lblOverviewScAvgPrice, - averageAllCurrent, - averageAllLast, - QString("B"), - 8); - - updateLabel(ui->lblOverviewBittrexBtc, - _bittrexMarketSummary->getLastCurrent(double()), - _bittrexMarketSummary->getLastPrev(double()), - QString("B"), - 8); - - updateLabel(ui->lblOverviewBittrexPerc, - (_bittrexMarketSummary->getLastCurrent(double()) - averageAllCurrent) / averageAllCurrent * 100, - 0, - QString(""), - QString("%"), - 2); - - updateLabel(ui->lblOverviewPoloniexBtc, - _poloniexMarketSummary->getLastCurrent(double()), - _poloniexMarketSummary->getLastPrev(double()), - QString("B"), - 8); - - updateLabel(ui->lblOverviewPoloniexPerc, - (_poloniexMarketSummary->getLastCurrent(double()) - averageAllCurrent) / averageAllCurrent * 100, - 0, - QString(""), - QString("%"), - 2); - - updateLabel(ui->lblOverviewCryptsyBtc, - _cryptsyTrades->getLastCurrent(double()), - _cryptsyTrades->getLastPrev(double()), - QString("B"), - 8); - - updateLabel(ui->lblOverviewCryptsyPerc, - (_cryptsyTrades->getLastCurrent(double()) - averageAllCurrent) / averageAllCurrent * 100, - 0, - QString(""), - QString("%"), - 2); -} - -void PoolBrowser::getRequest(const QString &urlString) { - QUrl url(urlString); - QNetworkRequest req(url); - req.setHeader(QNetworkRequest::ContentTypeHeader, "application/json; charset=utf-8"); - m_nam.get(req); -} - -void PoolBrowser::parseNetworkResponse(QNetworkReply* response) { - QUrl apiCall = response->url(); - - if (response->error() != QNetworkReply::NoError) { - //Communication error has occurred - emit networkError(response->error()); - return; - } - - if (apiCall == apiCoinbasePrice) { - coinbasePrice(response); - } else if (apiCall == apiBittrexMarketSummary) { - bittrexMarketSummary(response); - } else if (apiCall == apiBittrexTrades) { - bittrexTrades(response); - } else if (apiCall == apiBittrexOrders) { - bittrexOrders(response); - } else if (apiCall == apiPoloniexMarketSummary) { - poloniexMarketSummary(response); - } else if (apiCall == apiPoloniex24hVolume) { - poloniex24hVolume(response); - } else if (apiCall == apiPoloniexTrades) { - poloniexTrades(response); - } else if (apiCall == apiPoloniexOrders) { - poloniexOrders(response); - } else if (apiCall == apiCryptsyTrades) { - cryptsyTrades(response); - } else if (apiCall == apiCryptsyOrders) { - cryptsyOrders(response); - } else { } //Should NEVER get here unless something went completely awry - - if (_bittrexMarketSummary->getLastPrev(double()) > 0 && - _cryptsyTrades->getLastCurrent(double()) > 0 && - _poloniexMarketSummary->getLastCurrent(double()) > 0) { - ui->iconOverviewUpdateWait->setVisible(false); - } - - processOverview(); - - response->deleteLater(); -} - -void PoolBrowser::coinbasePrice(QNetworkReply* response) { - try { - mValue jsonResponse = new mValue(); - QString apiResponse = response->readAll(); - - //Make sure the response is valid - if (!read_string(apiResponse.toStdString(), jsonResponse)) { - return; - } - - mObject jsonObject = jsonResponse.get_obj(); - - _dBtcPriceCurrent = QString::fromStdString(getPairValue(jsonObject, "btc_to_usd").get_str()).toDouble(); - - updateLabel(ui->lblOverviewBtcUsdPrice, - _dBtcPriceCurrent, - _dBtcPriceLast, - QString('$'), - 2); - - _dBtcPriceLast = _dBtcPriceCurrent; - _dScPriceLast = _dBtcPriceCurrent * _bittrexMarketSummary->getLastCurrent(double()); - } catch (exception ex) { - printf("PoolBrowser::coinbasePrice: %s\r\n", ex.what()); - } -} - -void PoolBrowser::bittrexMarketSummary(QNetworkReply* response) { - try { - QString apiResponse = response->readAll(); - - apiResponse = apiResponse.replace("{\"success\":true,\"message\":\"\",\"result\":[", "").replace("]}", "").replace("},{", "}{"); - - QStringList qslApiResponse = apiResponse.split("{", QString::SkipEmptyParts); - - for (int i = 0; i < qslApiResponse.count(); i++) { - mValue jsonResponse = new mValue(); - - //Fix missing leading brace caused by split string, otherwise it will not be recognized an an mObject - qslApiResponse[i].replace("\"MarketName", "{\"MarketName"); - - //json_spirit does not handle null so make it "null" - qslApiResponse[i].replace("null", "\"null\""); - - //Make sure the response is valid - if (read_string(qslApiResponse[i].toStdString(), jsonResponse)) { - mObject jsonObject = jsonResponse.get_obj(); - - if (getPairValue(jsonObject, "MarketName").get_str() == "BTC-SC") { - try { - _bittrexMarketSummary->setHighCurrent(getPairValue(jsonObject, "High").get_real()); - _bittrexMarketSummary->setLowCurrent(getPairValue(jsonObject, "Low").get_real()); - _bittrexMarketSummary->setVolumeCurrent(getPairValue(jsonObject, "Volume").get_real()); - _bittrexMarketSummary->setLastCurrent(getPairValue(jsonObject, "Last").get_real()); - _bittrexMarketSummary->setBaseVolumeCurrent(getPairValue(jsonObject, "BaseVolume").get_real()); - _bittrexMarketSummary->setTimeStamp(getPairValue(jsonObject, "TimeStamp").get_str()); - _bittrexMarketSummary->setBidCurrent(getPairValue(jsonObject, "Bid").get_real()); - _bittrexMarketSummary->setAskCurrent(getPairValue(jsonObject, "Ask").get_real()); - _bittrexMarketSummary->setPrevDayCurrent(getPairValue(jsonObject, "PrevDay").get_real()); - } catch (exception ex) { - printf("PoolBrowser::bittrexMarketSummary: %s\r\n", ex.what()); //API did not return all needed data so skip processing market summary - } - - break; - } - } - } - - updateLabel(ui->lblBittrexHighBtc, - _bittrexMarketSummary->getHighCurrent(double()), - _bittrexMarketSummary->getHighPrev(double()), - QString("B"), - 8); - - updateLabel(ui->lblBittrexLowBtc, - _bittrexMarketSummary->getLowCurrent(double()), - _bittrexMarketSummary->getLowPrev(double()), - QString("B"), - 8); - - updateLabel(ui->lblBittrexCloseBtc, - _bittrexMarketSummary->getPrevDayCurrent(double()), - _bittrexMarketSummary->getPrevDayPrev(double()), - QString("B"), - 8); - - double changeCurrent = (_bittrexMarketSummary->getLastCurrent(double()) - _bittrexMarketSummary->getPrevDayCurrent(double())) / _bittrexMarketSummary->getPrevDayCurrent(double()) * 100; - double changeLast = (_bittrexMarketSummary->getLastPrev(double()) - _bittrexMarketSummary->getPrevDayCurrent(double())) / _bittrexMarketSummary->getPrevDayCurrent(double()) * 100; - - QString changeDirection = _bittrexMarketSummary->getLastCurrent(double()) > _bittrexMarketSummary->getPrevDayCurrent(double()) - ? QString("+") : _bittrexMarketSummary->getLastCurrent(double()) < _bittrexMarketSummary->getPrevDayCurrent(double()) - ? QString("") : QString(""); - - updateLabel(ui->lblBittrexChangePerc, - changeCurrent, - changeLast, - changeDirection, - QString("%"), - 2); - - updateLabel(ui->lblBittrexVolumeUsd, - _bittrexMarketSummary->getBaseVolumeCurrent(double()) * _dBtcPriceCurrent, - _bittrexMarketSummary->getBaseVolumePrev(double()) * _dBtcPriceCurrent, - QString(""), - 2); - - updateLabel(ui->lblBittrexVolumeSc, - _bittrexMarketSummary->getVolumeCurrent(double()), - _bittrexMarketSummary->getVolumePrev(double()), - QString(""), - 4); - - updateLabel(ui->lblBittrexVolumeBtc, - _bittrexMarketSummary->getBaseVolumeCurrent(double()), - _bittrexMarketSummary->getBaseVolumePrev(double()), - QString(""), - 4); - - updateLabel(ui->lblBittrexLastBtc, - _bittrexMarketSummary->getLastCurrent(double()), - _bittrexMarketSummary->getLastPrev(double()), - QString("B"), - 8); - - updateLabel(ui->lblBittrexLastUsd, - _bittrexMarketSummary->getLastCurrent(double()) * _dBtcPriceCurrent, - _bittrexMarketSummary->getLastPrev(double()) * _dBtcPriceCurrent, - QString("$"), - 8); - - updateLabel(ui->lblBittrexAskBtc, - _bittrexMarketSummary->getAskCurrent(double()), - _bittrexMarketSummary->getAskPrev(double()), - QString("B"), - 8); - - updateLabel(ui->lblBittrexAskUsd, - _bittrexMarketSummary->getAskCurrent(double()) * _dBtcPriceCurrent, - _bittrexMarketSummary->getAskPrev(double()) * _dBtcPriceCurrent, - QString("$"), - 8); - - updateLabel(ui->lblBittrexBidBtc, - _bittrexMarketSummary->getBidCurrent(double()), - _bittrexMarketSummary->getBidPrev(double()), - QString("B"), - 8); - - updateLabel(ui->lblBittrexBidUsd, - _bittrexMarketSummary->getBidCurrent(double()) * _dBtcPriceCurrent, - _bittrexMarketSummary->getBidPrev(double()) * _dBtcPriceCurrent, - QString("$"), - 8); - - _bittrexMarketSummary->setAskPrev(_bittrexMarketSummary->getAskCurrent(double())); - _bittrexMarketSummary->setBaseVolumePrev(_bittrexMarketSummary->getBaseVolumeCurrent(double())); - _bittrexMarketSummary->setBidPrev(_bittrexMarketSummary->getBidCurrent(double())); - _bittrexMarketSummary->setHighPrev(_bittrexMarketSummary->getHighCurrent(double())); - _bittrexMarketSummary->setLowPrev(_bittrexMarketSummary->getLowCurrent(double())); - _bittrexMarketSummary->setPrevDayPrev(_bittrexMarketSummary->getPrevDayCurrent(double())); - _bittrexMarketSummary->setLastPrev(_bittrexMarketSummary->getLastCurrent(double())); - _bittrexMarketSummary->setVolumePrev(_bittrexMarketSummary->getVolumeCurrent(double())); - - _dScPriceLast = _dBtcPriceCurrent * _bittrexMarketSummary->getLastCurrent(double()); - } catch (exception ex) { - printf("PoolBrowser::bittrexMarketSummary: %s\r\n", ex.what()); - } -} -void PoolBrowser::bittrexTrades(QNetworkReply* response) { - try { - int z = 0; - double high = 0; - double low = 100000; - - ui->tblBittrexTrades->clear(); - ui->tblBittrexTrades->setColumnWidth(0, 60); - ui->tblBittrexTrades->setColumnWidth(1, 110); - ui->tblBittrexTrades->setColumnWidth(2, 110); - ui->tblBittrexTrades->setColumnWidth(3, 100); - ui->tblBittrexTrades->setColumnWidth(4, 160); - ui->tblBittrexTrades->setSortingEnabled(false); - - QString apiResponse = response->readAll(); - - apiResponse = apiResponse.replace("{\"success\":true,\"message\":\"\",\"result\":[", "").replace("]}", "").replace("},{", "}{"); - - QStringList qslApiResponse = apiResponse.split("{", QString::SkipEmptyParts); - - int tradeCount = qslApiResponse.count(); - QVector xAxis(tradeCount), yAxis(tradeCount); - - for (int i = 0; i < tradeCount; i++) { - mValue jsonResponse = new mValue(); - - //Fix missing leading brace caused by split string, otherwise it will not be recognized an an mObject - qslApiResponse[i].replace("\"Id", "{\"Id"); - - //json_spirit does not handle null so make it "null" - qslApiResponse[i].replace("null", "\"null\""); - - //Make sure the response is valid - if (read_string(qslApiResponse[i].toStdString(), jsonResponse)) { - mObject jsonObject = jsonResponse.get_obj(); - - try { - _bittrexTrades->setId(getPairValue(jsonObject, "Id").get_real()); - _bittrexTrades->setTimeStamp(getPairValue(jsonObject, "TimeStamp").get_str()); - _bittrexTrades->setQuantity(getPairValue(jsonObject, "Quantity").get_real()); - _bittrexTrades->setPrice(getPairValue(jsonObject, "Price").get_real()); - _bittrexTrades->setTotal(getPairValue(jsonObject, "Total").get_real()); - _bittrexTrades->setFillType(getPairValue(jsonObject, "FillType").get_str()); - _bittrexTrades->setOrderType(getPairValue(jsonObject, "OrderType").get_str()); - } catch (exception ex) { - printf("PoolBrowser::bittrexTrades: %s\r\n", ex.what()); //API did not return all needed data so skip this trade - } - - QTreeWidgetItem * qtTrades = new QTreeWidgetItem(); - - qtTrades->setText(0, _bittrexTrades->getOrderType()); - qtTrades->setText(1, _bittrexTrades->getPrice(QString())); - qtTrades->setText(2, _bittrexTrades->getQuantity(QString())); - qtTrades->setText(3, _bittrexTrades->getTotal(QString())); - qtTrades->setText(4, _bittrexTrades->getTimeStamp()); - - ui->tblBittrexTrades->addTopLevelItem(qtTrades); - - xAxis[z] = tradeCount - z; - yAxis[z] = _bittrexTrades->getPrice(double()) * 100000000; - - high = _bittrexTrades->getPrice(double()) > high ? _bittrexTrades->getPrice(double()) : high; - low = _bittrexTrades->getPrice(double()) < low ? _bittrexTrades->getPrice(double()) : low; - - z++; - } - } - - high *= 100000000; - low *= 100000000; - - ui->qCustomPlotBittrexTrades->graph(0)->setData(xAxis, yAxis); - ui->qCustomPlotBittrexTrades->graph(0)->setPen(QPen(QColor(34, 177, 76))); - ui->qCustomPlotBittrexTrades->graph(0)->setBrush(QBrush(QColor(34, 177, 76, 20))); - - ui->qCustomPlotBittrexTrades->xAxis->setRange(1, tradeCount); - ui->qCustomPlotBittrexTrades->yAxis->setRange(low, high); - - ui->qCustomPlotBittrexTrades->replot(); - } catch (exception ex) { - printf("PoolBrowser::bittrexTrades: %s\r\n", ex.what()); - } -} -void PoolBrowser::bittrexOrders(QNetworkReply* response) { - try { - int z = 0; - double high = 0; - double low = 100000; - double sumBuys = 0; - double sumSells = 0; - double sumHighest = 0; - - ui->qTreeWidgetBittrexBuy->clear(); - ui->qTreeWidgetBittrexBuy->sortByColumn(0, Qt::DescendingOrder); - ui->qTreeWidgetBittrexBuy->setSortingEnabled(true); - - ui->qTreeWidgetBittrexSell->clear(); - ui->qTreeWidgetBittrexSell->sortByColumn(0, Qt::AscendingOrder); - ui->qTreeWidgetBittrexSell->setSortingEnabled(true); - - QString apiResponse = response->readAll(); - - apiResponse = apiResponse.replace("{\"success\":true,\"message\":\"\",\"result\":{\"buy\":[", ""); - QStringList qslApiResponse = apiResponse.split("],\"sell\":["); - - QStringList qslApiResponseBuys = qslApiResponse[0].replace("},{", "}{").split("{", QString::SkipEmptyParts); - QStringList qslApiResponseSells = qslApiResponse[1].replace("]}}", "").replace("},{", "}{").split("{", QString::SkipEmptyParts); - - //Use shorest depth as limit and use buy length if they are the same - int depth = qslApiResponseBuys.length() > qslApiResponseSells.length() - ? qslApiResponseSells.length() : qslApiResponseSells.length() > qslApiResponseBuys.length() - ? qslApiResponseBuys.length() : qslApiResponseBuys.length(); - - //Prevent overflow by limiting depth to 50 - //Also check for odd number of orders and drop the last one - //To avoid an overflow when there are less than 50 orders - depth = depth > 50 - ? 50 : depth % 2 == 1 - ? depth - 1 : depth; - - QVector xAxisBuys(depth), yAxisBuys(depth); - QVector xAxisSells(depth), yAxisSells(depth); - - for (int i = 0; i < depth; i++) { - mValue jsonResponse = new mValue(); - - //Fix missing leading brace caused by split string, otherwise it will not be recognized an an mObject - qslApiResponseBuys[i].replace("\"Quantity", "{\"Quantity"); - qslApiResponseSells[i].replace("\"Quantity", "{\"Quantity"); - - //json_spirit does not handle null so make it "null" - qslApiResponseBuys[i].replace("null", "\"null\""); - qslApiResponseSells[i].replace("null", "\"null\""); - - //Make sure the response is valid - if (read_string(qslApiResponseBuys[i].toStdString(), jsonResponse)) { - mObject jsonObjectBuys = jsonResponse.get_obj(); - - try { - _bittrexOrders->setQuantity(getPairValue(jsonObjectBuys, "Quantity").get_real()); - _bittrexOrders->setPrice(getPairValue(jsonObjectBuys, "Rate").get_real()); - _bittrexOrders->setOrderType("Buy"); - } catch (exception ex) { - printf("PoolBrowser::bittrexOrders: %s\r\n", ex.what()); //API did not return all needed data so skip this order - } - - QTreeWidgetItem * qtBuys = new QTreeWidgetItem(); - - qtBuys->setText(0, _bittrexOrders->getPrice(QString())); - qtBuys->setText(1, _bittrexOrders->getQuantity(QString())); - - ui->qTreeWidgetBittrexBuy->addTopLevelItem(qtBuys); - - sumBuys += _bittrexOrders->getQuantity(double()); - xAxisBuys[z] = _bittrexOrders->getPrice(double()) * 100000000; - yAxisBuys[z] = sumBuys; - } - - high = _bittrexOrders->getPrice(double()) > high ? _bittrexOrders->getPrice(double()) : high; - low = _bittrexOrders->getPrice(double()) < low ? _bittrexOrders->getPrice(double()) : low; - - //Make sure the response is valid - if (read_string(qslApiResponseSells[i].toStdString(), jsonResponse)) { - mObject jsonObjectSells = jsonResponse.get_obj(); - - try { - _bittrexOrders->setQuantity(getPairValue(jsonObjectSells, "Quantity").get_real()); - _bittrexOrders->setPrice(getPairValue(jsonObjectSells, "Rate").get_real()); - _bittrexOrders->setOrderType("Sell"); - } catch (exception ex) { - printf("PoolBrowser::bittrexOrders: %s\r\n", ex.what()); //API did not return all needed data so skip this order - } - - QTreeWidgetItem * qtSells = new QTreeWidgetItem(); - - qtSells->setText(0, _bittrexOrders->getPrice(QString())); - qtSells->setText(1, _bittrexOrders->getQuantity(QString())); - - ui->qTreeWidgetBittrexSell->addTopLevelItem(qtSells); - - sumSells += _bittrexOrders->getQuantity(double()); - xAxisSells[z] = _bittrexOrders->getPrice(double()) * 100000000; - yAxisSells[z] = sumSells; - } - - high = _bittrexOrders->getPrice(double()) > high ? _bittrexOrders->getPrice(double()) : high; - low = _bittrexOrders->getPrice(double()) < low ? _bittrexOrders->getPrice(double()) : low; - - z++; - } - - high *= 100000000; - low *= 100000000; - - sumHighest = sumBuys > sumSells ? sumBuys : sumBuys < sumSells ? sumSells : sumBuys; - - ui->qCustomPlotBittrexOrderDepth->graph(0)->setData(xAxisBuys, yAxisBuys); - ui->qCustomPlotBittrexOrderDepth->graph(1)->setData(xAxisSells, yAxisSells); - - ui->qCustomPlotBittrexOrderDepth->graph(0)->setPen(QPen(QColor(34, 177, 76))); - ui->qCustomPlotBittrexOrderDepth->graph(0)->setBrush(QBrush(QColor(34, 177, 76, 20))); - ui->qCustomPlotBittrexOrderDepth->graph(1)->setPen(QPen(QColor(237, 24, 35))); - ui->qCustomPlotBittrexOrderDepth->graph(1)->setBrush(QBrush(QColor(237, 24, 35, 20))); - - ui->qCustomPlotBittrexOrderDepth->xAxis->setRange(low, high); - ui->qCustomPlotBittrexOrderDepth->yAxis->setRange(low, sumHighest); - - ui->qCustomPlotBittrexOrderDepth->replot(); - } catch (exception ex) { - printf("PoolBrowser::bittrexOrders: %s\r\n", ex.what()); - } -} - -void PoolBrowser::poloniexMarketSummary(QNetworkReply* response) { - try { - QJsonParseError *error = new QJsonParseError(); - QJsonDocument apiResponse = QJsonDocument::fromJson(response->readAll(), error); - QJsonObject jsonObject = apiResponse.object(); - - QJsonObject scMarket = jsonObject["BTC_SC"].toObject(); - - _poloniexMarketSummary->setLastCurrent(scMarket["last"].toString()); - _poloniexMarketSummary->setAskCurrent(scMarket["lowestAsk"].toString()); - _poloniexMarketSummary->setBidCurrent(scMarket["highestBid"].toString()); - _poloniexMarketSummary->setPercentChangeCurrent(scMarket["percentChange"].toString()); - - updateLabel(ui->lblPoloniexChangePerc, - _poloniexMarketSummary->getPercentChangeCurrent(double() * 100), - _poloniexMarketSummary->getPercentChangePrev(double() * 100), - QString(""), - QString("%"), - 2); - - updateLabel(ui->lblPoloniexLastBtc, - _poloniexMarketSummary->getLastCurrent(double()), - _poloniexMarketSummary->getLastPrev(double()), - QString("B"), - 8); - - updateLabel(ui->lblPoloniexLastUsd, - _poloniexMarketSummary->getLastCurrent(double()) * _dBtcPriceCurrent, - _poloniexMarketSummary->getLastPrev(double()) * _dBtcPriceCurrent, - QString("$"), - 8); - - updateLabel(ui->lblPoloniexAskBtc, - _poloniexMarketSummary->getAskCurrent(double()), - _poloniexMarketSummary->getAskPrev(double()), - QString("B"), - 8); - - updateLabel(ui->lblPoloniexAskUsd, - _poloniexMarketSummary->getAskCurrent(double()) * _dBtcPriceCurrent, - _poloniexMarketSummary->getAskPrev(double()) * _dBtcPriceCurrent, - QString("$"), - 8); - - updateLabel(ui->lblPoloniexBidBtc, - _poloniexMarketSummary->getBidCurrent(double()), - _poloniexMarketSummary->getBidPrev(double()), - QString("B"), - 8); - - updateLabel(ui->lblPoloniexBidUsd, - _poloniexMarketSummary->getBidCurrent(double()) * _dBtcPriceCurrent, - _poloniexMarketSummary->getBidPrev(double()) * _dBtcPriceCurrent, - QString("$"), - 8); - - _poloniexMarketSummary->setAskPrev(_poloniexMarketSummary->getAskCurrent(double())); - _poloniexMarketSummary->setBidPrev(_poloniexMarketSummary->getBidCurrent(double())); - _poloniexMarketSummary->setLastPrev(_poloniexMarketSummary->getLastCurrent(double())); - - _dScPriceLast = _dBtcPriceCurrent * _poloniexMarketSummary->getLastCurrent(double()); - } catch (exception ex) { - printf("PoolBrowser::poloniexMarketSummary: %s\r\n", ex.what()); - } -} -void PoolBrowser::poloniex24hVolume(QNetworkReply* response) { - try { - QJsonParseError *error = new QJsonParseError(); - QJsonDocument apiResponse = QJsonDocument::fromJson(response->readAll(), error); - QJsonArray jsonArray = apiResponse.array(); - - QJsonObject scMarket = jsonArray[0].toObject(); - - _poloninex24hVolume->setHighCurrent(scMarket["high"].toDouble()); - _poloninex24hVolume->setLowCurrent(scMarket["low"].toDouble()); - _poloninex24hVolume->setPrevDayCurrent(scMarket["close"].toDouble()); - _poloninex24hVolume->setBaseVolumeCurrent(scMarket["volume"].toDouble()); - _poloninex24hVolume->setVolumeCurrent(scMarket["quoteVolume"].toDouble()); - - updateLabel(ui->lblPoloniexHighBtc, - _poloninex24hVolume->getHighCurrent(double()), - _poloninex24hVolume->getHighPrev(double()), - QString("B"), - 8); - - updateLabel(ui->lblPoloniexLowBtc, - _poloninex24hVolume->getLowCurrent(double()), - _poloninex24hVolume->getLowPrev(double()), - QString("B"), - 8); - - updateLabel(ui->lblPoloniexCloseBtc, - _poloninex24hVolume->getPrevDayCurrent(double()), - _poloninex24hVolume->getPrevDayPrev(double()), - QString("B"), - 8); - - updateLabel(ui->lblPoloniexVolumeUsd, - _poloninex24hVolume->getBaseVolumeCurrent(double()) * _dBtcPriceCurrent, - _poloninex24hVolume->getBaseVolumePrev(double()) * _dBtcPriceCurrent, - QString(""), - 2); - - updateLabel(ui->lblPoloniexVolumeSc, - _poloninex24hVolume->getVolumeCurrent(double()), - _poloninex24hVolume->getVolumePrev(double()), - QString(""), - 4); - - updateLabel(ui->lblPoloniexVolumeBtc, - _poloninex24hVolume->getBaseVolumeCurrent(double()), - _poloninex24hVolume->getBaseVolumePrev(double()), - QString(""), - 4); - - _poloninex24hVolume->setHighPrev(_poloninex24hVolume->getHighCurrent(double())); - _poloninex24hVolume->setLowPrev(_poloninex24hVolume->getLowCurrent(double())); - _poloninex24hVolume->setPrevDayPrev(_poloninex24hVolume->getPrevDayCurrent(double())); - _poloninex24hVolume->setBaseVolumePrev(_poloninex24hVolume->getBaseVolumeCurrent(double())); - _poloninex24hVolume->setVolumePrev(_poloninex24hVolume->getVolumeCurrent(double())); - } catch (exception ex) { - printf("PoolBrowser::poloniex24hVolume: %s\r\n", ex.what()); - } -} -void PoolBrowser::poloniexTrades(QNetworkReply* response) { - try { - int z = 0; - double high = 0; - double low = 100000; - - ui->tblPoloniexTrades->clear(); - ui->tblPoloniexTrades->setColumnWidth(0, 60); - ui->tblPoloniexTrades->setColumnWidth(1, 110); - ui->tblPoloniexTrades->setColumnWidth(2, 110); - ui->tblPoloniexTrades->setColumnWidth(3, 100); - ui->tblPoloniexTrades->setColumnWidth(4, 160); - ui->tblPoloniexTrades->setSortingEnabled(false); - - QJsonParseError *error = new QJsonParseError(); - QJsonDocument apiResponse = QJsonDocument::fromJson(response->readAll(), error); - QJsonArray jsonArray = apiResponse.array(); - - int tradeCount = jsonArray.size(); - QVector xAxis(tradeCount), yAxis(tradeCount); - - for (int i = 0; i < tradeCount; i++) { - try { - QJsonObject trade = jsonArray[i].toObject(); - - _poloniexTrades->setId(trade["tradeID"].toString()); - _poloniexTrades->setTimeStamp(trade["date"].toString()); - _poloniexTrades->setOrderType(trade["type"].toString().toStdString()); - _poloniexTrades->setPrice(trade["rate"].toString()); - _poloniexTrades->setQuantity(trade["amount"].toString()); - _poloniexTrades->setTotal(trade["total"].toString()); - - } catch (exception) {} //API did not return all needed data so skip this trade - - QTreeWidgetItem * qtTrades = new QTreeWidgetItem(); - - qtTrades->setText(0, _poloniexTrades->getOrderType()); - qtTrades->setText(1, _poloniexTrades->getPrice(QString())); - qtTrades->setText(2, _poloniexTrades->getQuantity(QString())); - qtTrades->setText(3, _poloniexTrades->getTotal(QString())); - qtTrades->setText(4, _poloniexTrades->getTimeStamp()); - - ui->tblPoloniexTrades->addTopLevelItem(qtTrades); - - xAxis[z] = tradeCount - z; - yAxis[z] = _poloniexTrades->getPrice(double()) * 100000000; - - high = _poloniexTrades->getPrice(double()) > high ? _poloniexTrades->getPrice(double()) : high; - low = _poloniexTrades->getPrice(double()) < low ? _poloniexTrades->getPrice(double()) : low; - - z++; - } - - high *= 100000000; - low *= 100000000; - - ui->qCustomPlotPoloniexTrades->graph(0)->setData(xAxis, yAxis); - ui->qCustomPlotPoloniexTrades->graph(0)->setPen(QPen(QColor(34, 177, 76))); - ui->qCustomPlotPoloniexTrades->graph(0)->setBrush(QBrush(QColor(34, 177, 76, 20))); - - ui->qCustomPlotPoloniexTrades->xAxis->setRange(1, tradeCount); - ui->qCustomPlotPoloniexTrades->yAxis->setRange(low, high); - - ui->qCustomPlotPoloniexTrades->replot(); - } catch (exception ex) { - printf("PoolBrowser::poloniexTrades: %s\r\n", ex.what()); - } -} -void PoolBrowser::poloniexOrders(QNetworkReply* response) { - try { - int z = 0; - double high = 0; - double low = 100000; - double sumBuys = 0; - double sumSells = 0; - double sumHighest = 0; - - ui->qTreeWidgetPoloniexBuy->clear(); - ui->qTreeWidgetPoloniexBuy->sortByColumn(0, Qt::DescendingOrder); - ui->qTreeWidgetPoloniexBuy->setSortingEnabled(true); - - ui->qTreeWidgetPoloniexSell->clear(); - ui->qTreeWidgetPoloniexSell->sortByColumn(0, Qt::AscendingOrder); - ui->qTreeWidgetPoloniexSell->setSortingEnabled(true); - - QJsonParseError *error = new QJsonParseError(); - QJsonDocument apiResponse = QJsonDocument::fromJson(response->readAll(), error); - QJsonObject jsonObject = apiResponse.object(); - QJsonArray jsonValueAsks = jsonObject["asks"].toArray(); - QJsonArray jsonValueBids = jsonObject["bids"].toArray(); - - //Use shorest depth as limit and use bid size if they are the same - int depth = jsonValueBids.size() > jsonValueAsks.size() - ? jsonValueAsks.size() : jsonValueAsks.size() > jsonValueBids.size() - ? jsonValueBids.size() : jsonValueBids.size(); - - //Prevent overflow by limiting depth to 50 - //Also check for odd number of orders and drop the last one - //To avoid an overflow when there are less than 50 orders - depth = depth > 50 - ? 50 : depth % 2 == 1 - ? depth - 1 : depth; - - QVector xAxisBuys(depth), yAxisBuys(depth); - QVector xAxisSells(depth), yAxisSells(depth); - - for (int i = 0; i < depth; i++) { - QJsonArray asks = jsonValueAsks[i].toArray(); - - _poloniexOrders->setPrice(asks[0].toString()); - _poloniexOrders->setQuantity(asks[1].toDouble()); - _poloniexOrders->setOrderType("Sell"); - - QTreeWidgetItem * qtSells = new QTreeWidgetItem(); - - qtSells->setText(0, _poloniexOrders->getPrice(QString())); - qtSells->setText(1, _poloniexOrders->getQuantity(QString())); - - ui->qTreeWidgetPoloniexSell->addTopLevelItem(qtSells); - - sumSells += _poloniexOrders->getQuantity(double()); - xAxisSells[z] = _poloniexOrders->getPrice(double()) * 100000000; - yAxisSells[z] = sumSells; - - high = _poloniexOrders->getPrice(double()) > high ? _poloniexOrders->getPrice(double()) : high; - low = _poloniexOrders->getPrice(double()) < low ? _poloniexOrders->getPrice(double()) : low; - - QJsonArray bids = jsonValueBids[i].toArray(); - - _poloniexOrders->setPrice(bids[0].toString()); - _poloniexOrders->setQuantity(bids[1].toDouble()); - _poloniexOrders->setOrderType("Buy"); - - QTreeWidgetItem * qtBuys = new QTreeWidgetItem(); - - qtBuys->setText(0, _poloniexOrders->getPrice(QString())); - qtBuys->setText(1, _poloniexOrders->getQuantity(QString())); - - ui->qTreeWidgetPoloniexBuy->addTopLevelItem(qtBuys); - - sumBuys += _poloniexOrders->getQuantity(double()); - xAxisBuys[z] = _poloniexOrders->getPrice(double()) * 100000000; - yAxisBuys[z] = sumBuys; - - high = _poloniexOrders->getPrice(double()) > high ? _poloniexOrders->getPrice(double()) : high; - low = _poloniexOrders->getPrice(double()) < low ? _poloniexOrders->getPrice(double()) : low; - - z++; - } - - high *= 100000000; - low *= 100000000; - - sumHighest = sumBuys > sumSells ? sumBuys : sumBuys < sumSells ? sumSells : sumBuys; - - ui->qCustomPlotPoloniexOrderDepth->graph(0)->setData(xAxisBuys, yAxisBuys); - ui->qCustomPlotPoloniexOrderDepth->graph(1)->setData(xAxisSells, yAxisSells); - - ui->qCustomPlotPoloniexOrderDepth->graph(0)->setPen(QPen(QColor(34, 177, 76))); - ui->qCustomPlotPoloniexOrderDepth->graph(0)->setBrush(QBrush(QColor(34, 177, 76, 20))); - ui->qCustomPlotPoloniexOrderDepth->graph(1)->setPen(QPen(QColor(237, 24, 35))); - ui->qCustomPlotPoloniexOrderDepth->graph(1)->setBrush(QBrush(QColor(237, 24, 35, 20))); - - ui->qCustomPlotPoloniexOrderDepth->xAxis->setRange(low, high); - ui->qCustomPlotPoloniexOrderDepth->yAxis->setRange(low, sumHighest); - - ui->qCustomPlotPoloniexOrderDepth->replot(); - } catch (exception ex) { - printf("PoolBrowser::poloniexOrders: %s\r\n", ex.what()); - } -} - -void PoolBrowser::cryptsyTrades(QNetworkReply* response) { - try { - int z = 0; - double high = 0; - double low = 100000; - - ui->tblCryptsyTrades->clear(); - ui->tblCryptsyTrades->setColumnWidth(0, 60); - ui->tblCryptsyTrades->setColumnWidth(1, 110); - ui->tblCryptsyTrades->setColumnWidth(2, 110); - ui->tblCryptsyTrades->setColumnWidth(3, 100); - ui->tblCryptsyTrades->setColumnWidth(4, 160); - ui->tblCryptsyTrades->setSortingEnabled(false); - - QString apiResponse = response->readAll(); - - QStringList qslApiResponse = apiResponse.replace("{\"success\":1,\"return\":{\"markets\":{\"SC\":", "").replace(",\"recenttrades\":", "}").replace("]}}}}", "").replace("},{", "}{").split("["); - QString apiResponseMarketSummary = qslApiResponse[0].replace("\\", ""); - QStringList qslApiResponseTrades = qslApiResponse[1].split("{", QString::SkipEmptyParts); - - mValue jsonResponseMarketSummary = new mValue(); - - if (!read_string(apiResponseMarketSummary.toStdString(), jsonResponseMarketSummary)) { - return; - } - - mObject jsonObjectMarketSummary = jsonResponseMarketSummary.get_obj(); - - _cryptsyTrades->setLastCurrent(getPairValue(jsonObjectMarketSummary, "lasttradeprice").get_str()); - _cryptsyTrades->setVolumeCurrent(getPairValue(jsonObjectMarketSummary, "volume").get_str()); - - int tradeCount = qslApiResponseTrades.count(); - - //Prevent overflow by limiting trade data to no more than 100 - tradeCount = tradeCount > 100 - ? 100 : tradeCount % 2 == 1 - ? tradeCount - 1 : tradeCount; - - QVector xAxis(tradeCount), yAxis(tradeCount); - - for (int i = 0; i < tradeCount; i++) { - mValue jsonResponse = new mValue(); - - //Fix missing leading brace caused by split string, otherwise it will not be recognized an an mObject - qslApiResponseTrades[i].replace("\"id", "{\"id"); - - //json_spirit does not handle null so make it "null" - qslApiResponseTrades[i].replace("null", "\"null\""); - - //Make sure the response is valid - if (read_string(qslApiResponseTrades[i].toStdString(), jsonResponse)) { - mObject jsonObject = jsonResponse.get_obj(); - - try { - _cryptsyTrades->setId(getPairValue(jsonObject, "id").get_str()); - _cryptsyTrades->setTimeStamp(getPairValue(jsonObject, "time").get_str()); - _cryptsyTrades->setPrice(getPairValue(jsonObject, "price").get_str()); - _cryptsyTrades->setQuantity(getPairValue(jsonObject, "quantity").get_str()); - _cryptsyTrades->setTotal(getPairValue(jsonObject, "total").get_str()); - _cryptsyTrades->setOrderType(getPairValue(jsonObject, "type").get_str()); - } catch (exception ex) { - printf("PoolBrowser::cryptsyTrades: %s\r\n", ex.what()); //API did not return all needed data so skip this trade - } - - QTreeWidgetItem * qtTrades = new QTreeWidgetItem(); - - qtTrades->setText(0, _cryptsyTrades->getOrderType()); - qtTrades->setText(1, _cryptsyTrades->getPrice(QString())); - qtTrades->setText(2, _cryptsyTrades->getQuantity(QString())); - qtTrades->setText(3, _cryptsyTrades->getTotal(QString())); - qtTrades->setText(4, _cryptsyTrades->getTimeStamp()); - - ui->tblCryptsyTrades->addTopLevelItem(qtTrades); - - xAxis[z] = tradeCount - z; - yAxis[z] = _cryptsyTrades->getPrice(double()) * 100000000; - - high = _cryptsyTrades->getPrice(double()) > high ? _cryptsyTrades->getPrice(double()) : high; - low = _cryptsyTrades->getPrice(double()) < low ? _cryptsyTrades->getPrice(double()) : low; - - z++; - } - } - - high *= 100000000; - low *= 100000000; - - updateLabel(ui->lblCryptsyVolumeSc, - _cryptsyTrades->getVolumeCurrent(double()), - _cryptsyTrades->getVolumePrev(double()), - QString(""), - 4); - - updateLabel(ui->lblCryptsyVolumeBtc, - _cryptsyTrades->getVolumeCurrent(double()) * _cryptsyTrades->getLastCurrent(double()), - _cryptsyTrades->getVolumePrev(double()) * _cryptsyTrades->getLastCurrent(double()), - QString(""), - 4); - - updateLabel(ui->lblCryptsyVolumeUsd, - _cryptsyTrades->getVolumeCurrent(double()) * _cryptsyTrades->getLastCurrent(double()) * _dBtcPriceCurrent, - _cryptsyTrades->getVolumePrev(double()) * _cryptsyTrades->getLastCurrent(double()) * _dBtcPriceCurrent, - QString(""), - 4); - - updateLabel(ui->lblCryptsyLastBtc, - _cryptsyTrades->getLastCurrent(double()), - _cryptsyTrades->getLastPrev(double()), - QString("B"), - 8); - - updateLabel(ui->lblCryptsyLastUsd, - _cryptsyTrades->getLastCurrent(double()) * _dBtcPriceCurrent, - _cryptsyTrades->getLastPrev(double()) * _dBtcPriceCurrent, - QString("$"), - 8); - - ui->qCustomPlotCryptsyTrades->graph(0)->setData(xAxis, yAxis); - ui->qCustomPlotCryptsyTrades->graph(0)->setPen(QPen(QColor(34, 177, 76))); - ui->qCustomPlotCryptsyTrades->graph(0)->setBrush(QBrush(QColor(34, 177, 76, 20))); - - ui->qCustomPlotCryptsyTrades->xAxis->setRange(1, tradeCount); - ui->qCustomPlotCryptsyTrades->yAxis->setRange(low, high); - - ui->qCustomPlotCryptsyTrades->replot(); - - _cryptsyTrades->setLastPrev(_cryptsyTrades->getLastCurrent(QString()).toStdString()); - _cryptsyTrades->setVolumePrev(_cryptsyTrades->getVolumeCurrent(QString()).toStdString()); - } catch (exception ex) { - printf("PoolBrowser::cryptsyTrades: %s\r\n", ex.what()); - } -} -void PoolBrowser::cryptsyOrders(QNetworkReply* response) { - try { - int z = 0; - double high = 0; - double low = 100000; - double sumBuys = 0; - double sumSells = 0; - double sumHighest = 0; - - ui->qTreeWidgetCryptsyBuy->clear(); - ui->qTreeWidgetCryptsyBuy->sortByColumn(0, Qt::DescendingOrder); - ui->qTreeWidgetCryptsyBuy->setSortingEnabled(true); - - ui->qTreeWidgetCryptsySell->clear(); - ui->qTreeWidgetCryptsySell->sortByColumn(0, Qt::AscendingOrder); - ui->qTreeWidgetCryptsySell->setSortingEnabled(true); - - QString apiResponse = response->readAll(); - - apiResponse = apiResponse.replace("{\"success\":1,\"return\":{\"SILK\":{\"marketid\":\"225\",\"label\":\"SILK\\/BTC\",\"primaryname\":\"SilkCoin\",\"primarycode\":\"SILK\",\"secondaryname\":\"BitCoin\",\"secondarycode\":\"BTC\",\"sellorders\":[", ""); - QStringList qslApiResponse = apiResponse.split("],\"buyorders\":["); - - QStringList qslApiResponseSells = qslApiResponse[0].replace("},{", "}{").split("{", QString::SkipEmptyParts); - QStringList qslApiResponseBuys = qslApiResponse[1].replace("]}}}", "").replace("},{", "}{").split("{", QString::SkipEmptyParts); - - //Use shorest depth as limit and use buy length if they are the same - int depth = qslApiResponseBuys.length() > qslApiResponseSells.length() - ? qslApiResponseSells.length() : qslApiResponseSells.length() > qslApiResponseBuys.length() - ? qslApiResponseBuys.length() : qslApiResponseBuys.length(); - - //Prevent overflow by limiting depth to 50 - //Also check for odd number of orders and drop the last one - //To avoid an overflow when there are less than 50 orders - depth = depth > 50 - ? 50 : depth % 2 == 1 - ? depth - 1 : depth; - - QVector xAxisBuys(depth), yAxisBuys(depth); - QVector xAxisSells(depth), yAxisSells(depth); - - for (int i = 0; i < depth; i++) { - mValue jsonResponse = new mValue(); - - //Fix missing leading brace caused by split string, otherwise it will not be recognized an an mObject - qslApiResponseBuys[i].replace("\"price", "{\"price"); - qslApiResponseSells[i].replace("\"price", "{\"price"); - - //json_spirit does not handle null so make it "null" - qslApiResponseBuys[i].replace("null", "\"null\""); - qslApiResponseSells[i].replace("null", "\"null\""); - - //Make sure the response is valid - if (read_string(qslApiResponseBuys[i].toStdString(), jsonResponse)) { - mObject jsonObjectBuys = jsonResponse.get_obj(); - - try { - _cryptsyOrders->setQuantity(getPairValue(jsonObjectBuys, "quantity").get_str()); - _cryptsyOrders->setPrice(getPairValue(jsonObjectBuys, "price").get_str()); - _cryptsyOrders->setOrderType("Buy"); - } catch (exception ex) { - printf("PoolBrowser::cryptsyOrders: %s\r\n", ex.what()); //API did not return all needed data so skip this order - } - - QTreeWidgetItem * qtBuys = new QTreeWidgetItem(); - - qtBuys->setText(0, _cryptsyOrders->getPrice(QString())); - qtBuys->setText(1, _cryptsyOrders->getQuantity(QString())); - - ui->qTreeWidgetCryptsyBuy->addTopLevelItem(qtBuys); - - sumBuys += _cryptsyOrders->getQuantity(double()); - xAxisBuys[z] = _cryptsyOrders->getPrice(double()) * 100000000; - yAxisBuys[z] = sumBuys; - } - - high = _cryptsyOrders->getPrice(double()) > high ? _cryptsyOrders->getPrice(double()) : high; - low = _cryptsyOrders->getPrice(double()) < low ? _cryptsyOrders->getPrice(double()) : low; - - string WTF = qslApiResponseSells[i].toStdString(); - - //Make sure the response is valid - if (read_string(qslApiResponseSells[i].toStdString(), jsonResponse)) { - mObject jsonObjectSells = jsonResponse.get_obj(); - - try { - _cryptsyOrders->setQuantity(getPairValue(jsonObjectSells, "quantity").get_str()); - _cryptsyOrders->setPrice(getPairValue(jsonObjectSells, "price").get_str()); - _cryptsyOrders->setOrderType("Sell"); - } catch (exception ex) { - printf("PoolBrowser::cryptsyOrders: %s\r\n", ex.what()); //API did not return all needed data so skip this order - } - - QTreeWidgetItem * qtSells = new QTreeWidgetItem(); - - qtSells->setText(0, _cryptsyOrders->getPrice(QString())); - qtSells->setText(1, _cryptsyOrders->getQuantity(QString())); - - ui->qTreeWidgetCryptsySell->addTopLevelItem(qtSells); - - sumSells += _cryptsyOrders->getQuantity(double()); - xAxisSells[z] = _cryptsyOrders->getPrice(double()) * 100000000; - yAxisSells[z] = sumSells; - } - - high = _cryptsyOrders->getPrice(double()) > high ? _cryptsyOrders->getPrice(double()) : high; - low = _cryptsyOrders->getPrice(double()) < low ? _cryptsyOrders->getPrice(double()) : low; - - z++; - } - - high *= 100000000; - low *= 100000000; - - sumHighest = sumBuys > sumSells ? sumBuys : sumBuys < sumSells ? sumSells : sumBuys; - - ui->qCustomPlotCryptsyOrderDepth->graph(0)->setData(xAxisBuys, yAxisBuys); - ui->qCustomPlotCryptsyOrderDepth->graph(1)->setData(xAxisSells, yAxisSells); - - ui->qCustomPlotCryptsyOrderDepth->graph(0)->setPen(QPen(QColor(34, 177, 76))); - ui->qCustomPlotCryptsyOrderDepth->graph(0)->setBrush(QBrush(QColor(34, 177, 76, 20))); - ui->qCustomPlotCryptsyOrderDepth->graph(1)->setPen(QPen(QColor(237, 24, 35))); - ui->qCustomPlotCryptsyOrderDepth->graph(1)->setBrush(QBrush(QColor(237, 24, 35, 20))); - - ui->qCustomPlotCryptsyOrderDepth->xAxis->setRange(low, high); - ui->qCustomPlotCryptsyOrderDepth->yAxis->setRange(low, sumHighest); - - ui->qCustomPlotCryptsyOrderDepth->replot(); - } catch (exception ex) { - printf("PoolBrowser::cryptsyOrders: %s\r\n", ex.what()); - } -} - -const mValue& PoolBrowser::getPairValue(const mObject& obj, const string& name) { - mObject::const_iterator iter = obj.find(name); - - assert(iter != obj.end()); - assert(iter->first == name); - - return iter->second; -} - -void PoolBrowser::updateLabel(QLabel* qLabel, double d1, double d2, QString prefix, int decimalPlaces) { - qLabel->setText(""); - - if (d1 > d2) { - qLabel->setText(prefix + "" + QString::number(d1, 'f', decimalPlaces) + ""); - } else if (d1 < d2) { - qLabel->setText(prefix + "" + QString::number(d1, 'f', decimalPlaces) + ""); - } else { - qLabel->setText(prefix + QString::number(d1, 'f', decimalPlaces)); - } -} -void PoolBrowser::updateLabel(QLabel* qLabel, double d1, double d2, QString prefix, QString suffix, int decimalPlaces) { - qLabel->setText(""); - - if (d1 > d2) { - qLabel->setText(prefix + "" + QString::number(d1, 'f', decimalPlaces) + suffix + ""); - } else if (d1 < d2) { - qLabel->setText(prefix + "" + QString::number(d1, 'f', decimalPlaces) + suffix + ""); - } else { - qLabel->setText(prefix + QString::number(d1, 'f', decimalPlaces) + suffix); - } -} - -void PoolBrowser::setModel(ClientModel *model) { - this->model = model; -} - -PoolBrowser::~PoolBrowser() { - delete ui; -} diff --git a/src/qt/poolbrowser.h b/src/qt/poolbrowser.h deleted file mode 100644 index e2a6ae7..0000000 --- a/src/qt/poolbrowser.h +++ /dev/null @@ -1,995 +0,0 @@ -#ifndef POOLBROWSER_H -#define POOLBROWSER_H - -#include "clientmodel.h" -#include "main.h" -#include "wallet.h" -#include "base58.h" - -#include "json_spirit.h" - -#include -#include -#include -#include - -#ifndef BOOST_SPIRIT_THREADSAFE -#define BOOST_SPIRIT_THREADSAFE -#endif - -using namespace json_spirit; - -extern double _dScPriceLast; -extern double _dBtcPriceCurrent; -extern double _dBtcPriceLast; - -namespace Ui { -class PoolBrowser; -} - -class ClientModel; - -class PoolBrowser : public QWidget { - Q_OBJECT - - public: - explicit PoolBrowser(QWidget* parent = 0); - ~PoolBrowser(); - - void pollAPIs(); - - void processOverview(); - - //API Call Methods - void coinbasePrice(QNetworkReply* response); - void bittrexMarketSummary(QNetworkReply* response); - void bittrexTrades(QNetworkReply* response); - void bittrexOrders(QNetworkReply* response); - void poloniexMarketSummary(QNetworkReply* response); - void poloniexTrades(QNetworkReply* response); - void poloniexOrders(QNetworkReply* response); - void poloniexVolume(QNetworkReply* response); - void poloniex24hVolume (QNetworkReply* response); - void cryptsyTrades(QNetworkReply* response); - void cryptsyOrders(QNetworkReply* response); - - const mValue& getPairValue(const mObject& obj, const string& name); - - void updateLabel(QLabel* qLabel, double d1, double d2, QString prefix, int decimalPlaces); - void updateLabel(QLabel* qLabel, double d1, double d2, QString prefix, QString suffix, int decimalPlaces); - - void setModel(ClientModel* model); - - private: - void getRequest(const QString& url); - - signals: - void networkError(QNetworkReply::NetworkError err); - - public slots: - void parseNetworkResponse(QNetworkReply* response); - - private slots: - void on_btnConvertSilkoin_clicked(); - void on_btnUpdateMarketData_clicked(); - - void on_lblBittrexMarketLink_linkActivated(const QString &link); - void on_lblPoloniexMarketLink_linkActivated(const QString &link); - void on_lblCryptsyMarketLink_linkActivated(const QString &link); - - private: - QNetworkAccessManager m_nam; - Ui::PoolBrowser* ui; - ClientModel* model; -}; - -class BittrexMarketSummary { - private: - double _askCurrent; - double _askPrev; - double _baseVolumeCurrent; - double _baseVolumePrev; - double _bidCurrent; - double _bidPrev; - double _highCurrent; - double _highPrev; - double _lastCurrent; - double _lastPrev; - double _lowCurrent; - double _lowPrev; - double _prevDayCurrent; - double _prevDayPrev; - double _volumeCurrent; - double _volumePrev; - - QString _created; - QString _displayMarketName; - QString _marketName; - QString _timeStamp; - - public: - BittrexMarketSummary() { - _askCurrent = 0; - _askPrev = 0; - _baseVolumeCurrent = 0; - _baseVolumePrev = 0; - _bidCurrent = 0; - _bidPrev = 0; - _highCurrent = 0; - _highPrev = 0; - _lastCurrent = 0; - _lastPrev = 0; - _lowCurrent = 0; - _lowPrev = 0; - _prevDayCurrent = 0; - _prevDayPrev = 0; - _volumeCurrent = 0; - _volumePrev = 0; - - _created = ""; - _displayMarketName = ""; - _marketName = ""; - _timeStamp = ""; - } - - double getAskCurrent(double) { - return _askCurrent; - } - QString getAskCurrent(QString) { - return QString::number(_askCurrent, 'f', 8); - } - void setAskCurrent(double value) { - _askCurrent = value; - } - - double getAskPrev(double) { - return _askPrev; - } - QString getAskPrev(QString) { - return QString::number(_askPrev, 'f', 8); - } - void setAskPrev(double value) { - _askPrev = value; - } - - double getBaseVolumeCurrent(double) { - return _baseVolumeCurrent; - } - QString getBaseVolumeCurrent(QString) { - return QString::number(_baseVolumeCurrent, 'f', 8); - } - void setBaseVolumeCurrent(double value) { - _baseVolumeCurrent = value; - } - - double getBaseVolumePrev(double) { - return _baseVolumePrev; - } - QString getBaseVolumePrev(QString) { - return QString::number(_baseVolumePrev, 'f', 8); - } - void setBaseVolumePrev(double value) { - _baseVolumePrev = value; - } - - double getBidCurrent(double) { - return _bidCurrent; - } - QString getBidCurrent(QString) { - return QString::number(_bidCurrent, 'f', 8); - } - void setBidCurrent(double value) { - _bidCurrent = value; - } - - double getBidPrev(double) { - return _bidPrev; - } - QString getBidPrev(QString) { - return QString::number(_bidPrev, 'f', 8); - } - void setBidPrev(double value) { - _bidPrev = value; - } - - double getHighCurrent(double) { - return _highCurrent; - } - QString getHighCurrent(QString) { - return QString::number(_highCurrent, 'f', 8); - } - void setHighCurrent(double value) { - _highCurrent = value; - } - - double getHighPrev(double) { - return _highPrev; - } - QString getHighPrev(QString) { - return QString::number(_highPrev, 'f', 8); - } - void setHighPrev(double value) { - _highPrev = value; - } - - double getLastCurrent(double) { - return _lastCurrent; - } - QString getLastCurrent(QString) { - return QString::number(_lastCurrent, 'f', 8); - } - void setLastCurrent(double value) { - _lastCurrent = value; - } - - double getLastPrev(double) { - return _lastPrev; - } - QString getLastPrev(QString) { - return QString::number(_lastPrev, 'f', 8); - } - void setLastPrev(double value) { - _lastPrev = value; - } - - double getLowCurrent(double) { - return _lowCurrent; - } - QString getLowCurrent(QString) { - return QString::number(_lowCurrent, 'f', 8); - } - void setLowCurrent(double value) { - _lowCurrent = value; - } - - double getLowPrev(double) { - return _lowPrev; - } - QString getLowPrev(QString) { - return QString::number(_lowPrev, 'f', 8); - } - void setLowPrev(double value) { - _lowPrev = value; - } - - double getPrevDayCurrent(double) { - return _prevDayCurrent; - } - QString getPrevDayCurrent(QString) { - return QString::number(_prevDayCurrent, 'f', 8); - } - void setPrevDayCurrent(double value) { - _prevDayCurrent = value; - } - - double getPrevDayPrev(double) { - return _prevDayPrev; - } - QString getPrevDayPrev(QString) { - return QString::number(_prevDayPrev, 'f', 8); - } - void setPrevDayPrev(double value) { - _prevDayPrev = value; - } - - double getVolumeCurrent(double) { - return _volumeCurrent; - } - QString getVolumeCurrent(QString) { - return QString::number(_volumeCurrent, 'f', 8); - } - void setVolumeCurrent(double value) { - _volumeCurrent = value; - } - - double getVolumePrev(double) { - return _volumePrev; - } - QString getVolumePrev(QString) { - return QString::number(_volumePrev, 'f', 8); - } - void setVolumePrev(double value) { - _volumePrev = value; - } - - QString getCreated() { - return _created; - } - void setCreated(string value) { - QString ret = QString::fromStdString(value); - - ret.replace("T", " "); - ret.truncate(ret.indexOf(".")); - - _created = ret; - } - - QString _getDisplayMarketName() { - return _displayMarketName; - } - void setDisplayMarketName(string value) { - _displayMarketName = QString::fromStdString(value); - } - - QString getMarketName() { - return _marketName; - } - void setMarketName(string value) { - _marketName = QString::fromStdString(value); - } - - QString getTimeStamp() { - return _timeStamp; - } - void setTimeStamp(string value) { - QString ret = QString::fromStdString(value); - - ret.replace("T", " "); - ret.truncate(ret.indexOf(".")); - - _timeStamp = ret; - } -}; - -class BittrexTrades { - private: - double _id; - QString _timeStamp; - double _quantity; - double _price; - double _total; - QString _fillType; - QString _orderType; - - public: - BittrexTrades() { - _id = 0; - _timeStamp = ""; - _quantity = 0; - _price = 0; - _total = 0; - _fillType = ""; - _orderType = ""; - } - - double getId(double) { - return _id; - } - QString getId(QString) { - return QString::number(_id, 'f', 8); - } - void setId(double value) { - _id = value; - } - - QString getTimeStamp() { - return _timeStamp; - } - void setTimeStamp(string value) { - QString ret = QString::fromStdString(value); - - ret.replace("T", " "); - ret.truncate(ret.indexOf(".")); - - _timeStamp = ret; - } - - double getQuantity(double) { - return _quantity; - } - QString getQuantity(QString) { - return QString::number(_quantity, 'f', 8); - } - void setQuantity(double value) { - _quantity = value; - } - - double getPrice(double) { - return _price; - } - QString getPrice(QString) { - return QString::number(_price, 'f', 8); - } - void setPrice(double value) { - _price = value; - } - - double getTotal(double) { - return _total; - } - QString getTotal(QString) { - return QString::number(_total, 'f', 8); - } - void setTotal(double value) { - _total = value; - } - - QString getFillType() { - return _fillType; - } - void setFillType(string value) { - _fillType = QString::fromStdString(value); - } - - QString getOrderType() { - return _orderType; - } - void setOrderType(string value) { - _orderType = QString::fromStdString(value) == "BUY" - ? "Buy" : QString::fromStdString(value) == "SELL" - ? "Sell" : "Unknown"; - } -}; - -class BittrexOrders { - private: - double _quantity; - double _price; - QString _orderType; - - public: - BittrexOrders() { - _quantity = 0; - _price = 0; - _orderType = ""; - } - - double getQuantity(double) { - return _quantity; - } - QString getQuantity(QString) { - return QString::number(_quantity, 'f', 8); - } - void setQuantity(double value) { - _quantity = value; - } - - double getPrice(double) { - return _price; - } - QString getPrice(QString) { - return QString::number(_price, 'f', 8); - } - void setPrice(double value) { - _price = value; - } - - QString getOrderType() { - return _orderType; - } - void setOrderType(string value) { - _orderType = QString::fromStdString(value); - } -}; - -class PoloniexMarketSummary { - private: - double _askCurrent; - double _askPrev; - double _bidCurrent; - double _bidPrev; - double _lastCurrent; - double _lastPrev; - double _percentChangeCurrent; - double _percentChangePrev; - - QString _timeStamp; - - public: - PoloniexMarketSummary() { - _askCurrent = 0; - _askPrev = 0; - _bidCurrent = 0; - _bidPrev = 0; - _lastCurrent = 0; - _lastPrev = 0; - _percentChangeCurrent = 0; - _percentChangePrev = 0; - - _timeStamp = ""; - } - - double getAskCurrent(double) { - return _askCurrent; - } - QString getAskCurrent(QString) { - return QString::number(_askCurrent, 'f', 8); - } - void setAskCurrent(QString value) { - _askCurrent = value.toDouble(); - } - - double getAskPrev(double) { - return _askPrev; - } - QString getAskPrev(QString) { - return QString::number(_askPrev, 'f', 8); - } - void setAskPrev(double value) { - _askPrev = value; - } - - double getBidCurrent(double) { - return _bidCurrent; - } - QString getBidCurrent(QString) { - return QString::number(_bidCurrent, 'f', 8); - } - void setBidCurrent(QString value) { - _bidCurrent = value.toDouble(); - } - - double getBidPrev(double) { - return _bidPrev; - } - QString getBidPrev(QString) { - return QString::number(_bidPrev, 'f', 8); - } - void setBidPrev(double value) { - _bidPrev = value; - } - - double getLastCurrent(double) { - return _lastCurrent; - } - QString getLastCurrent(QString) { - return QString::number(_lastCurrent, 'f', 8); - } - void setLastCurrent(QString value) { - _lastCurrent = value.toDouble(); - } - - double getLastPrev(double) { - return _lastPrev; - } - QString getLastPrev(QString) { - return QString::number(_lastPrev, 'f', 8); - } - void setLastPrev(double value) { - _lastPrev = value; - } - - double getPercentChangeCurrent(double) { - return _percentChangeCurrent; - } - QString getPercentChangeCurrent(QString) { - return QString::number(_percentChangeCurrent, 'f', 8); - } - void setPercentChangeCurrent(QString value) { - _percentChangeCurrent = value.toDouble(); - } - - double getPercentChangePrev(double) { - return _percentChangePrev; - } - QString getPercentChangePrev(QString) { - return QString::number(_percentChangePrev, 'f', 8); - } - void setPercentChangePrev(QString value) { - _percentChangePrev = value.toDouble(); - } - - QString getTimeStamp() { - return _timeStamp; - } - void setTimeStamp(string value) { - QString ret = QString::fromStdString(value); - - ret.replace("T", " "); - ret.truncate(ret.indexOf(".")); - - _timeStamp = ret; - } -}; - -class Poloniex24hVolume { - private: - double _baseVolumeCurrent; - double _baseVolumePrev; - double _highCurrent; - double _highPrev; - double _lowCurrent; - double _lowPrev; - double _prevDayCurrent; - double _prevDayPrev; - double _volumeCurrent; - double _volumePrev; - - public: - Poloniex24hVolume() { - _baseVolumeCurrent = 0; - _baseVolumePrev = 0; - _highCurrent = 0; - _highPrev = 0; - _lowCurrent = 0; - _lowPrev = 0; - _prevDayCurrent = 0; - _prevDayPrev = 0; - _volumeCurrent = 0; - _volumePrev = 0; - } - - double getBaseVolumeCurrent(double) { - return _baseVolumeCurrent; - } - QString getBaseVolumeCurrent(QString) { - return QString::number(_baseVolumeCurrent, 'f', 8); - } - void setBaseVolumeCurrent(double value) { - _baseVolumeCurrent = value; - } - - double getBaseVolumePrev(double) { - return _baseVolumePrev; - } - QString getBaseVolumePrev(QString) { - return QString::number(_baseVolumePrev, 'f', 8); - } - void setBaseVolumePrev(double value) { - _baseVolumePrev = value; - } - - double getHighCurrent(double) { - return _highCurrent; - } - QString getHighCurrent(QString) { - return QString::number(_highCurrent, 'f', 8); - } - void setHighCurrent(double value) { - _highCurrent = value; - } - - double getHighPrev(double) { - return _highPrev; - } - QString getHighPrev(QString) { - return QString::number(_highPrev, 'f', 8); - } - void setHighPrev(double value) { - _highPrev = value; - } - - double getLowCurrent(double) { - return _lowCurrent; - } - QString getLowCurrent(QString) { - return QString::number(_lowCurrent, 'f', 8); - } - void setLowCurrent(double value) { - _lowCurrent = value; - } - - double getLowPrev(double) { - return _lowPrev; - } - QString getLowPrev(QString) { - return QString::number(_lowPrev, 'f', 8); - } - void setLowPrev(double value) { - _lowPrev = value; - } - - double getPrevDayCurrent(double) { - return _prevDayCurrent; - } - QString getPrevDayCurrent(QString) { - return QString::number(_prevDayCurrent, 'f', 8); - } - void setPrevDayCurrent(double value) { - _prevDayCurrent = value; - } - - double getPrevDayPrev(double) { - return _prevDayPrev; - } - QString getPrevDayPrev(QString) { - return QString::number(_prevDayPrev, 'f', 8); - } - void setPrevDayPrev(double value) { - _prevDayPrev = value; - } - - double getVolumeCurrent(double) { - return _volumeCurrent; - } - QString getVolumeCurrent(QString) { - return QString::number(_volumeCurrent, 'f', 8); - } - void setVolumeCurrent(double value) { - _volumeCurrent = value; - } - - double getVolumePrev(double) { - return _volumePrev; - } - QString getVolumePrev(QString) { - return QString::number(_volumePrev, 'f', 8); - } - void setVolumePrev(double value) { - _volumePrev = value; - } -}; - -class PoloniexTrades { - private: - double _id; - QString _timeStamp; - double _quantity; - double _price; - double _total; - QString _fillType; - QString _orderType; - - public: - PoloniexTrades() { - _id = 0; - _timeStamp = ""; - _quantity = 0; - _price = 0; - _total = 0; - _fillType = ""; - _orderType = ""; - } - - double getId(double) { - return _id; - } - QString getId(QString) { - return QString::number(_id, 'f', 8); - } - void setId(QString value) { - _id = value.toDouble(); - } - - QString getTimeStamp() { - return _timeStamp; - } - void setTimeStamp(QString value) { - _timeStamp = value; - } - - double getQuantity(double) { - return _quantity; - } - QString getQuantity(QString) { - return QString::number(_quantity, 'f', 8); - } - void setQuantity(QString value) { - _quantity = value.toDouble(); - } - - double getPrice(double) { - return _price; - } - QString getPrice(QString) { - return QString::number(_price, 'f', 8); - } - void setPrice(QString value) { - _price = value.toDouble(); - } - - double getTotal(double) { - return _total; - } - QString getTotal(QString) { - return QString::number(_total, 'f', 8); - } - void setTotal(QString value) { - _total = value.toDouble(); - } - - QString getOrderType() { - return _orderType; - } - void setOrderType(string value) { - _orderType = QString::fromStdString(value) == "buy" - ? "Buy" : QString::fromStdString(value) == "sell" - ? "Sell" : "Unknown"; - } -}; - -class PoloniexOrders { - private: - double _quantity; - double _price; - QString _orderType; - - public: - PoloniexOrders() { - _quantity = 0; - _price = 0; - _orderType = ""; - } - - double getQuantity(double) { - return _quantity; - } - QString getQuantity(QString) { - return QString::number(_quantity, 'f', 8); - } - void setQuantity(double value) { - _quantity = value; - } - - double getPrice(double) { - return _price; - } - QString getPrice(QString) { - return QString::number(_price, 'f', 8); - } - void setPrice(QString value) { - _price = value.toDouble(); - } - - QString getOrderType() { - return _orderType; - } - void setOrderType(string value) { - _orderType = QString::fromStdString(value); - } -}; - -class CryptsyTrades { - private: - double _id; - QString _timeStamp; - QString _orderType; - double _price; - double _quantity; - double _total; - double _lastCurrent; - double _lastPrev; - double _volumeCurrent; - double _volumePrev; - - public: - CryptsyTrades() { - _id = 0; - _timeStamp = ""; - _orderType = ""; - _price = 0; - _quantity = 0; - _total = 0; - _lastCurrent = 0; - _lastPrev = 0; - _volumeCurrent = 0; - _volumePrev = 0; - } - - double getId(double) { - return _id; - } - QString getId(QString) { - return QString::number(_id, 'f', 8); - } - void setId(string value) { - _id = QString::fromStdString(value).toDouble(); - } - - QString getTimeStamp() { - return _timeStamp; - } - void setTimeStamp(string value) { - _timeStamp = QString::fromStdString(value); - } - - QString getOrderType() { - return _orderType; - } - void setOrderType(string value) { - _orderType = QString::fromStdString(value); - } - - double getPrice(double) { - return _price; - } - QString getPrice(QString) { - return QString::number(_price, 'f', 8); - } - void setPrice(string value) { - _price = QString::fromStdString(value).toDouble(); - } - - double getQuantity(double) { - return _quantity; - } - QString getQuantity(QString) { - return QString::number(_quantity, 'f', 8); - } - void setQuantity(string value) { - _quantity = QString::fromStdString(value).toDouble(); - } - - double getTotal(double) { - return _total; - } - QString getTotal(QString) { - return QString::number(_total, 'f', 8); - } - void setTotal(string value) { - _total = QString::fromStdString(value).toDouble(); - } - - double getLastCurrent(double) { - return _lastCurrent; - } - QString getLastCurrent(QString) { - return QString::number(_lastCurrent, 'f', 8); - } - void setLastCurrent(string value) { - _lastCurrent = QString::fromStdString(value).toDouble(); - } - - double getLastPrev(double) { - return _lastPrev; - } - QString getLastPrev(QString) { - return QString::number(_lastPrev, 'f', 8); - } - void setLastPrev(string value) { - _lastPrev = QString::fromStdString(value).toDouble(); - } - - double getVolumeCurrent(double) { - return _volumeCurrent; - } - QString getVolumeCurrent(QString) { - return QString::number(_volumeCurrent, 'f', 8); - } - void setVolumeCurrent(string value) { - _volumeCurrent = QString::fromStdString(value).toDouble(); - } - - double getVolumePrev(double) { - return _volumePrev; - } - QString getVolumePrev(QString) { - return QString::number(_volumePrev, 'f', 8); - } - void setVolumePrev(string value) { - _volumePrev = QString::fromStdString(value).toDouble(); - } -}; - -class CryptsyOrders { - private: - double _quantity; - double _price; - QString _orderType; - - public: - CryptsyOrders() { - _quantity = 0; - _price = 0; - _orderType = ""; - } - - double getQuantity(double) { - return _quantity; - } - QString getQuantity(QString) { - return QString::number(_quantity, 'f', 8); - } - void setQuantity(string value) { - _quantity = QString::fromStdString(value).toDouble(); - } - - double getPrice(double) { - return _price; - } - QString getPrice(QString) { - return QString::number(_price, 'f', 8); - } - void setPrice(string value) { - _price = QString::fromStdString(value).toDouble(); - } - - QString getOrderType() { - return _orderType; - } - void setOrderType(string value) { - _orderType = QString::fromStdString(value); - } -}; - -#endif // POOLBROWSER_H diff --git a/src/qt/res/images/about.png b/src/qt/res/images/about.png index b647056..5413175 100644 Binary files a/src/qt/res/images/about.png and b/src/qt/res/images/about.png differ diff --git a/src/qt/res/images/background.png b/src/qt/res/images/background.png index 60d4e2d..339d709 100644 Binary files a/src/qt/res/images/background.png and b/src/qt/res/images/background.png differ diff --git a/src/qt/res/images/head.png b/src/qt/res/images/head.png index 91685f3..10df75f 100644 Binary files a/src/qt/res/images/head.png and b/src/qt/res/images/head.png differ diff --git a/src/qt/res/images/splash.png b/src/qt/res/images/splash.png index 42c7e2e..ff38d54 100644 Binary files a/src/qt/res/images/splash.png and b/src/qt/res/images/splash.png differ diff --git a/src/qt/statisticspage.cpp b/src/qt/statisticspage.cpp deleted file mode 100644 index d6c3a89..0000000 --- a/src/qt/statisticspage.cpp +++ /dev/null @@ -1,173 +0,0 @@ -#include "statisticspage.h" -#include "ui_statisticspage.h" -#include "main.h" -#include "wallet.h" -#include "init.h" -#include "base58.h" -#include "clientmodel.h" -#include "bitcoinrpc.h" -#include "poolbrowser.h" -#include -#include - -using namespace json_spirit; - -StatisticsPage::StatisticsPage(QWidget *parent) : - QWidget(parent), - ui(new Ui::StatisticsPage) { - ui->setupUi(this); - - setFixedSize(400, 420); - - connect(ui->startButton, SIGNAL(pressed()), this, SLOT(updateStatistics())); -} - -int heightPrevious = -1; -int connectionPrevious = -1; -int volumePrevious = -1; -double rewardPrevious = -1; -double netPawratePrevious = -1; -double pawratePrevious = -1; -double hardnessPrevious = -1; -double hardnessPrevious2 = -1; -int stakeminPrevious = -1; -int stakemaxPrevious = -1; -int64_t marketcapPrevious = -1; -QString stakecPrevious = ""; - - -void StatisticsPage::updateStatistics() { - double pHardness = GetDifficulty(); - double pHardness2 = GetDifficulty(GetLastBlockIndex(pindexBest, true)); - int pPawrate = GetPoWMHashPS(); - double pPawrate2 = 0.000; - int nHeight = pindexBest->nHeight; - double nSubsidy = 2500; - uint64_t nMinWeight = 0, nMaxWeight = 0, nWeight = 0; - pwalletMain->GetStakeWeight(*pwalletMain, nMinWeight, nMaxWeight, nWeight); - uint64_t nNetworkWeight = GetPoSKernelPS(); - int64_t volume = ((pindexBest->nMoneySupply) / 100000000); - int64_t marketcap = _dScPriceLast * volume; - int peers = this->model->getNumConnections(); - pPawrate2 = (double)pPawrate; - ui->progressBar->setValue(nHeight); - QString height = QString::number(nHeight); - QString stakemin = QString::number(nMinWeight); - QString stakemax = QString::number(nNetworkWeight); - QString phase = ""; - - if (pindexBest->nHeight < 10001) { - phase = "

(1) POW - POS

"; - } else if (pindexBest->nHeight > 10000 && pindexBest->nHeight < 50001) { - phase = "

(2) POS

"; - ui->progressBar->setMinimum(10000); - ui->progressBar->setMaximum(50000); - } else if (pindexBest->nHeight > 50000 && pindexBest->nHeight < 60001) { - phase = "

(3) POW - POS

"; - - ui->progressBar->setMinimum(50000); - ui->progressBar->setMaximum(60000); - } else { - ui->progressBar->hide(); - phase = "

(4) POS

"; - } - - QString subsidy = QString::number(nSubsidy, 'f', 6); - QString hardness = QString::number(pHardness, 'f', 6); - QString hardness2 = QString::number(pHardness2, 'f', 6); - QString pawrate = QString::number(pPawrate2, 'f', 3); - QString Qlpawrate = model->getLastBlockDate().toString(); - - QString QPeers = QString::number(peers); - QString qVolume = QLocale(QLocale::English).toString((qlonglong)volume); - - if (nHeight > heightPrevious) { - ui->progressBar->setValue(nHeight); - ui->heightBox->setText("" + height + ""); - } else { - ui->heightBox->setText(height); - } - - if (0 > stakeminPrevious) { - ui->minBox->setText("" + stakemin + ""); - } else { - ui->minBox->setText(stakemin); - } - - if (0 > stakemaxPrevious) { - ui->maxBox->setText("" + stakemax + ""); - } else { - ui->maxBox->setText(stakemax); - } - - if (phase != stakecPrevious) { - ui->cBox->setText("" + phase + ""); - } else { - ui->cBox->setText(phase); - } - - if (marketcap > marketcapPrevious) { - ui->marketcap->setText("" + QString::number(marketcap) + " $"); - } else if (marketcap < marketcapPrevious) { - ui->marketcap->setText("" + QString::number(marketcap) + " $"); - } else { - ui->marketcap->setText(QString::number(marketcap) + " $"); - } - - if (pHardness2 > hardnessPrevious2) { - ui->diffBox2->setText("" + hardness2 + ""); - } else if (pHardness2 < hardnessPrevious2) { - ui->diffBox2->setText("" + hardness2 + ""); - } else { - ui->diffBox2->setText(hardness2); - } - - if (Qlpawrate != pawratePrevious) { - ui->localBox->setText("" + Qlpawrate + ""); - } else { - ui->localBox->setText(Qlpawrate); - } - - if (peers > connectionPrevious) { - ui->connectionBox->setText("" + QPeers + ""); - } else if (peers < connectionPrevious) { - ui->connectionBox->setText("" + QPeers + ""); - } else { - ui->connectionBox->setText(QPeers); - } - - if (volume > volumePrevious) { - ui->volumeBox->setText("" + qVolume + " SC" + ""); - } else if (volume < volumePrevious) { - ui->volumeBox->setText("" + qVolume + " SC" + ""); - } else { - ui->volumeBox->setText(qVolume + " SC"); - } - - updatePrevious(nHeight, nMinWeight, nNetworkWeight, phase, nSubsidy, pHardness, pHardness2, pPawrate2, Qlpawrate, peers, volume, marketcap); -} - -void StatisticsPage::updatePrevious(int nHeight, int nMinWeight, int nNetworkWeight, QString phase, double nSubsidy, double pHardness, double pHardness2, double pPawrate2, QString Qlpawrate, int peers, int volume, int64_t marketcap) { - heightPrevious = nHeight; - stakeminPrevious = nMinWeight; - stakemaxPrevious = nNetworkWeight; - stakecPrevious = phase; - rewardPrevious = nSubsidy; - hardnessPrevious = pHardness; - hardnessPrevious2 = pHardness2; - netPawratePrevious = pPawrate2; - pawratePrevious = Qlpawrate; - connectionPrevious = peers; - volumePrevious = volume; - marketcapPrevious = marketcap; -} - -void StatisticsPage::setModel(ClientModel *model) { - updateStatistics(); - this->model = model; -} - - -StatisticsPage::~StatisticsPage() { - delete ui; -} diff --git a/src/qt/statisticspage.h b/src/qt/statisticspage.h deleted file mode 100644 index 405b2a8..0000000 --- a/src/qt/statisticspage.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef STATISTICSPAGE_H -#define STATISTICSPAGE_H - -#include "clientmodel.h" -#include "main.h" -#include "wallet.h" -#include "base58.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -namespace Ui { -class StatisticsPage; -} -class ClientModel; - -class StatisticsPage : public QWidget { - Q_OBJECT - - public: - explicit StatisticsPage(QWidget *parent = 0); - ~StatisticsPage(); - - void setModel(ClientModel *model); - - int heightPrevious; - int connectionPrevious; - int volumePrevious; - int stakeminPrevious; - int stakemaxPrevious; - QString stakecPrevious; - double rewardPrevious; - double netPawratePrevious; - QString pawratePrevious; - double hardnessPrevious; - double hardnessPrevious2; - int64_t marketcapPrevious; - - public slots: - - void updateStatistics(); - void updatePrevious(int, int, int, QString, double, double, double, double, QString, int, int, int64_t); - - private slots: - - private: - Ui::StatisticsPage *ui; - ClientModel *model; - -}; - -#endif // STATISTICSPAGE_H diff --git a/src/version.cpp b/src/version.cpp index 155599a..36638aa 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -8,10 +8,10 @@ // Name of client reported in the 'version' message. Report the same name // for both bitcoind and bitcoin-qt, to make it harder for attackers to // target servers or GUI users specifically. -const std::string CLIENT_NAME("Satoshi"); +const std::string CLIENT_NAME("Silkcoin"); // Client version number -#define CLIENT_VERSION_SUFFIX "" +#define CLIENT_VERSION_SUFFIX "2.0" // The following part of the code determines the CLIENT_BUILD variable. diff --git a/src/version.h b/src/version.h index 2731dd0..4cb46f7 100644 --- a/src/version.h +++ b/src/version.h @@ -30,13 +30,13 @@ static const int DATABASE_VERSION = 70508; // network protocol versioning // -static const int PROTOCOL_VERSION = 60016; +static const int PROTOCOL_VERSION = 60017; //Increase of Protocol Version for Hard Fork // earlier versions not supported as of Feb 2012, and are disconnected static const int MIN_PROTO_VERSION = 209; // disconnect from peers older than this proto version -static const int MIN_PEER_PROTO_VERSION = 60014; +static const int MIN_PEER_PROTO_VERSION = 60016; //Increase of Protocol Version to Prevent Old Wallet Connections // nTime field added to CAddress, starting with this version; // if possible, avoid requesting addresses nodes older than this diff --git a/src/wallet.cpp b/src/wallet.cpp index 83746c9..e77c403 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1726,7 +1726,7 @@ bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int if (!txNew.GetCoinAge(txdb, nCoinAge)) return error("CreateCoinStake : failed to calculate coin age"); - int64_t nReward = GetProofOfStakeReward(nCoinAge, nFees); + int64_t nReward = GetProofOfStakeReward(nCoinAge, nBits, nFees, txNew.nTime); if (nReward <= 0) return false;