Skip to content

Commit

Permalink
Merge pull request #5 from zPools/master
Browse files Browse the repository at this point in the history
Version 1.2.0.1
  • Loading branch information
altcommunitycoin committed Jan 26, 2018
2 parents 99ea31c + 54648af commit 0d3ebef
Show file tree
Hide file tree
Showing 23 changed files with 150 additions and 3,168 deletions.
2 changes: 1 addition & 1 deletion install-dependencies.sh
Expand Up @@ -16,7 +16,7 @@ echo "nproc: $NPROC"
#################################################################
# Install all necessary packages for building Bhcoin #
#################################################################
sudo apt-get install -y qt4-qmake libqt4-dev libminiupnpc-dev libdb++-dev libdb-dev libcrypto++-dev libqrencode-dev libboost-all-dev build-essential libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libssl-dev libdb++-dev libssl-dev ufw git software-properties-common
sudo apt-get install -y qt4-qmake libqt4-dev libminiupnpc-dev libdb++-dev libdb-dev libcrypto++-dev libqrencode-dev libboost-all-dev build-essential libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libssl-dev libdb++-dev libssl-dev ufw git software-properties-common qt5-default
sudo add-apt-repository -y ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install -y libdb4.8-dev libdb4.8++-dev
Expand Down
2 changes: 1 addition & 1 deletion sono-qt.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
TARGET = SONO-qt
VERSION = 1.2.0.0
VERSION = 1.2.0.1
INCLUDEPATH += src src/json src/qt src/qt/plugins/mrichtexteditor
DEFINES += ENABLE_WALLET
DEFINES += BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
Expand Down
2 changes: 1 addition & 1 deletion src/clientversion.h
Expand Up @@ -9,7 +9,7 @@
#define CLIENT_VERSION_MAJOR 1
#define CLIENT_VERSION_MINOR 2
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 0
#define CLIENT_VERSION_BUILD 1

// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
Expand Down
12 changes: 10 additions & 2 deletions src/main.cpp
Expand Up @@ -2431,7 +2431,7 @@ bool CBlock::CheckBlock(bool fCheckPOW, bool fCheckMerkleRoot, bool fCheckSig) c
CBlockIndex *pindex = pindexBest;
if(IsProofOfStake() && pindex != NULL){
if(pindex->GetBlockHash() == hashPrevBlock){
CAmount masternodePaymentAmount = GetMasternodePayment(pindex->nHeight+1, vtx[1].GetValueOut());
int64_t masternodePaymentAmount = GetMasternodePayment(pindex->nHeight+1, vtx[1].GetValueOut());
bool fIsInitialDownload = IsInitialBlockDownload();

// If we don't already have its previous block, skip masternode payment step
Expand Down Expand Up @@ -3395,12 +3395,20 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
return false;
}


int64_t nTime;
CAddress addrMe;
CAddress addrFrom;
uint64_t nNonce = 1;
vRecv >> pfrom->nVersion >> pfrom->nServices >> nTime >> addrMe;
bool badVersion = false;

if (pfrom->nVersion < MIN_PEER_PROTO_VERSION)
badVersion = true;
if (nBestHeight >= 192500 && pfrom->nVersion < 70004)
badVersion = true;

if (badVersion)
{
// disconnect from peers older than this proto version
LogPrintf("partner %s using obsolete version %i; disconnecting\n", pfrom->addr.ToString(), pfrom->nVersion);
Expand Down Expand Up @@ -4287,7 +4295,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)

int64_t GetMasternodePayment(int nHeight, int64_t blockValue)
{
int64_t ret = blockValue * 0.25; // 25%
int64_t ret = blockValue * 0.25; //25% for masternodes

return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion src/net.cpp
Expand Up @@ -30,7 +30,7 @@
using namespace std;
using namespace boost;

static const int MAX_OUTBOUND_CONNECTIONS = 12; // Reduced to 12 connections. ( Manual edit to suit your needs)
static const int MAX_OUTBOUND_CONNECTIONS = 32; // Increased to 32 connections. ( Manual edit to suit your needs)

bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound = NULL, const char *strDest = NULL, bool fOneShot = false);

Expand Down
87 changes: 45 additions & 42 deletions src/qt/bitcoingui.cpp
Expand Up @@ -38,7 +38,7 @@
#include "messagepage.h"
#include "blockbrowser.h"
#include "forms/sidetoolbar.h"

#include "transactiondesc.h"

#ifdef Q_OS_MAC
#include "macdockiconhandler.h"
Expand Down Expand Up @@ -93,7 +93,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
{
//resize(970, 570);
resize(1080, 662);
setWindowTitle(tr("SONO") + " - " + tr("Wallet"));
setWindowTitle(tr("Project SONO") + " - " + tr("Wallet"));
#ifndef Q_OS_MAC
qApp->setWindowIcon(QIcon(":icons/bitcoin"));
setWindowIcon(QIcon(":icons/bitcoin"));
Expand Down Expand Up @@ -121,8 +121,8 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
// Create tabs
overviewPage = new OverviewPage();
// Create trading page
// tradingDialogPage = new tradingDialog(this);
// tradingDialogPage->setObjectName("tradingDialog");
// tradingDialogPage = new tradingDialog(this);
// tradingDialogPage->setObjectName("tradingDialog");

transactionsPage = new QWidget(this);
QVBoxLayout *vbox = new QVBoxLayout();
Expand All @@ -144,9 +144,9 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):

messagePage = new MessagePage(this);

//clientcontrolPage = new ClientControlPage(this);
// clientcontrolPage = new ClientControlPage(this);

//multisigPage = new MultisigDialog(this);
// multisigPage = new MultisigDialog(this);

centralStackedWidget = new QStackedWidget(this);

Expand All @@ -159,9 +159,9 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
centralStackedWidget->addWidget(masternodeManagerPage);
centralStackedWidget->addWidget(messagePage);
centralStackedWidget->addWidget(blockBrowser);
// centralStackedWidget->addWidget(clientcontrolPage);
//TradingAction->setChecked(true);
// centralStackedWidget->addWidget(tradingDialogPage);
// centralStackedWidget->addWidget(clientcontrolPage);
// TradingAction->setChecked(true);
// centralStackedWidget->addWidget(tradingDialogPage);

QWidget *centralWidget = new QWidget();
QVBoxLayout *centralLayout = new QVBoxLayout(centralWidget);
Expand Down Expand Up @@ -201,15 +201,13 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(labelBlocksIcon);
frameBlocksLayout->addStretch();
//frameBlocksLayout->addWidget(netLabel);
//frameBlocksLayout->addStretch();

toolbar->addWidget(frameBlocks);

if (GetBoolArg("-staking", true))
{
QTimer *timerStakingIcon = new QTimer(labelStakingIcon);
connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon()));
timerStakingIcon->start(20 * 1000);
timerStakingIcon->start(30 * 1000);
updateStakingIcon();
}

Expand All @@ -234,9 +232,6 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):

statusBar()->addWidget(progressBarLabel);
statusBar()->addWidget(progressBar);
statusBar()->addPermanentWidget(frameBlocks);
statusBar()->setObjectName("statusBar");
statusBar()->setStyleSheet("#statusBar { color: #101010; background-color: #f9f9f9); }");

syncIconMovie = new QMovie(fUseBlackTheme ? ":/movies/update_spinner_black" : ":/movies/update_spinner", "mng", this);

Expand Down Expand Up @@ -458,11 +453,8 @@ void BitcoinGUI::createToolBars()
fLiteMode = GetBoolArg("-litemode", false);

toolbar = new QToolBar(tr("Tabs toolbar"));

toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);

toolbar->setContextMenuPolicy(Qt::PreventContextMenu);

toolbar->setObjectName("tabs");
toolbar->setStyleSheet("QToolButton { color: #101010; font-weight:bold;} QToolButton:hover { background-color: #c1cbcb } QToolButton:checked { background-color: #c1cbcb } QToolButton:pressed { background-color: none } #tabs { color: #101010; background-color: #f9f9f9); }");

Expand All @@ -486,7 +478,7 @@ void BitcoinGUI::createToolBars()
toolbar->addAction(historyAction);
toolbar->addAction(addressBookAction);
toolbar->addAction(masternodeManagerAction);
// toolbar->addAction(clientcontrolAction);
// toolbar->addAction(clientcontrolAction);
toolbar->addAction(blockAction);

if (!fLiteMode){
Expand Down Expand Up @@ -756,49 +748,59 @@ void BitcoinGUI::setNumBlocks(int count)
statusBar()->setVisible(true);
}

void BitcoinGUI::message(const QString &title, const QString &message, bool modal, unsigned int style)
void BitcoinGUI::message(const QString& title, const QString& message, unsigned int style, bool* ret)
{
QString strTitle = tr("SONO") + " - ";
QString strTitle = tr("SONO"); // default title
// Default to information icon
int nMBoxIcon = QMessageBox::Information;
int nNotifyIcon = Notificator::Information;

// Check for usage of predefined title
switch (style) {
case CClientUIInterface::MSG_ERROR:
strTitle += tr("Error");
break;
case CClientUIInterface::MSG_WARNING:
strTitle += tr("Warning");
break;
case CClientUIInterface::MSG_INFORMATION:
strTitle += tr("Information");
break;
default:
strTitle += title; // Use supplied title
QString msgType;

// Prefer supplied title over style based title
if (!title.isEmpty()) {
msgType = title;
} else {
switch (style) {
case CClientUIInterface::MSG_ERROR:
msgType = tr("Error");
break;
case CClientUIInterface::MSG_WARNING:
msgType = tr("Warning");
break;
case CClientUIInterface::MSG_INFORMATION:
msgType = tr("Information");
break;
default:
break;
}
}
// Append title to "LUX - "
if (!msgType.isEmpty())
strTitle += " - " + msgType;

// Check for error/warning icon
if (style & CClientUIInterface::ICON_ERROR) {
nMBoxIcon = QMessageBox::Critical;
nNotifyIcon = Notificator::Critical;
}
else if (style & CClientUIInterface::ICON_WARNING) {
} else if (style & CClientUIInterface::ICON_WARNING) {
nMBoxIcon = QMessageBox::Warning;
nNotifyIcon = Notificator::Warning;
}

// Display message
if (modal) {
if (style & CClientUIInterface::MODAL) {
// Check for buttons, use OK as default, if none was supplied
QMessageBox::StandardButton buttons;
if (!(buttons = (QMessageBox::StandardButton)(style & CClientUIInterface::BTN_MASK)))
buttons = QMessageBox::Ok;

QMessageBox mBox((QMessageBox::Icon)nMBoxIcon, strTitle, message, buttons);
mBox.exec();
}
else
showNormalIfMinimized();
QMessageBox mBox((QMessageBox::Icon)nMBoxIcon, strTitle, message, buttons, this);
int r = mBox.exec();
if (ret != NULL)
*ret = r == QMessageBox::Ok;
} else
notificator->notify((Notificator::Class)nNotifyIcon, strTitle, message);
}

Expand Down Expand Up @@ -1271,6 +1273,7 @@ void BitcoinGUI::updateStakingIcon()
}
}


void BitcoinGUI::detectShutdown()
{
if (ShutdownRequested())
Expand Down
8 changes: 5 additions & 3 deletions src/qt/bitcoingui.h
Expand Up @@ -158,7 +158,7 @@ public slots:
@param[in] style style definitions (icon and used buttons - buttons only for message boxes)
@see CClientUIInterface::MessageBoxFlags
*/
void message(const QString &title, const QString &message, bool modal, unsigned int style);
void message(const QString& title, const QString& message, unsigned int style, bool* ret = NULL);
/** Asks the user whether to pay the transaction fee or to cancel the transaction.
It is currently not possible to pass a return value to another thread through
BlockingQueuedConnection, so an indirected pointer is used.
Expand Down Expand Up @@ -204,11 +204,13 @@ private slots:
/** Handle tray icon clicked */
void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
#endif
/** Show incoming transaction notification for new transactions.
/*
Show incoming transaction notification for new transactions.
The new items are those between start and end inclusive, under the given parent item.
*/

void incomingTransaction(const QModelIndex & parent, int start, int end);

void incomingMessage(const QModelIndex & parent, int start, int end);
/** Encrypt the wallet */
void encryptWallet();
Expand Down

0 comments on commit 0d3ebef

Please sign in to comment.