Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multisend #23

Merged
merged 3 commits into from
Jan 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Makefile.qt.include
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ QT_FORMS_UI = \
qt/forms/helpmessagedialog.ui \
qt/forms/intro.ui \
qt/forms/masternodelist.ui \
qt/forms/multisenddialog.ui \
qt/forms/openuridialog.ui \
qt/forms/optionsdialog.ui \
qt/forms/overviewpage.ui \
Expand Down Expand Up @@ -60,6 +61,7 @@ QT_MOC_CPP = \
qt/moc_macdockiconhandler.cpp \
qt/moc_macnotificationhandler.cpp \
qt/moc_masternodelist.cpp \
qt/moc_multisenddialog.cpp \
qt/moc_notificator.cpp \
qt/moc_openuridialog.cpp \
qt/moc_optionsdialog.cpp \
Expand Down Expand Up @@ -129,6 +131,7 @@ BITCOIN_QT_H = \
qt/macdockiconhandler.h \
qt/macnotificationhandler.h \
qt/masternodelist.h \
qt/multisenddialog.h \
qt/networkstyle.h \
qt/notificator.h \
qt/openuridialog.h \
Expand Down Expand Up @@ -268,6 +271,7 @@ BITCOIN_QT_CPP += \
qt/obfuscationconfig.cpp \
qt/editaddressdialog.cpp \
qt/masternodelist.cpp \
qt/multisenddialog.cpp \
qt/openuridialog.cpp \
qt/overviewpage.cpp \
qt/paymentrequestplus.cpp \
Expand Down
6 changes: 6 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3887,6 +3887,12 @@ bool ProcessNewBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDis
}
}

// If turned on MultiSend will send a transaction (or more) on the 30th confirmation of a stake
if (pwalletMain->fMultiSend)
if (!pwalletMain->MultiSend() )
LogPrintf("ERROR While trying to use MultiSend \n");


LogPrintf("%s : ACCEPTED\n", __func__);

return true;
Expand Down
24 changes: 21 additions & 3 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) :
openRPCConsoleAction(0),
openAction(0),
showHelpMessageAction(0),
multiSendAction(0),
trayIcon(0),
trayIconMenu(0),
notificator(0),
Expand Down Expand Up @@ -389,6 +390,9 @@ void BitcoinGUI::createActions(const NetworkStyle *networkStyle)
signMessageAction->setStatusTip(tr("Sign messages with your DarkNet addresses to prove you own them"));
verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this);
verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified DarkNet addresses"));
multiSendAction = new QAction(QIcon(":/icons/edit"), tr("&MultiSend"), this);
multiSendAction->setToolTip(tr("MultiSend Settings"));
multiSendAction->setCheckable(true);

openInfoAction = new QAction(QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation), tr("&Information"), this);
openInfoAction->setStatusTip(tr("Show diagnostic information"));
Expand Down Expand Up @@ -439,6 +443,7 @@ void BitcoinGUI::createActions(const NetworkStyle *networkStyle)
connect(usedSendingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedSendingAddresses()));
connect(usedReceivingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedReceivingAddresses()));
connect(openAction, SIGNAL(triggered()), this, SLOT(openClicked()));
connect(multiSendAction, SIGNAL(triggered()), this, SLOT(gotoMultiSendDialog()));
}
#endif // ENABLE_WALLET
}
Expand Down Expand Up @@ -475,6 +480,7 @@ void BitcoinGUI::createMenuBar()
settings->addAction(changePassphraseAction);
settings->addAction(unlockWalletAction);
settings->addAction(lockWalletAction);
settings->addAction(multiSendAction);
settings->addSeparator();
}
settings->addAction(optionsAction);
Expand Down Expand Up @@ -773,6 +779,13 @@ void BitcoinGUI::gotoTradingPage()
if (walletFrame) walletFrame->gotoTradingPage();
}

void BitcoinGUI::gotoMultiSendDialog()
{
multiSendAction->setChecked(true);
if(walletFrame)
walletFrame->gotoMultiSendDialog();
}

#endif // ENABLE_WALLET

void BitcoinGUI::setNumConnections(int count)
Expand Down Expand Up @@ -1021,7 +1034,7 @@ void BitcoinGUI::closeEvent(QCloseEvent *event)
void BitcoinGUI::incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address)
{
// On new transaction, make an info balloon
message((amount)<0 ? tr("Sent transaction") : tr("Incoming transaction"),
message((amount)<0 ? (fMultiSendNotify == true ? tr("Sent MultiSend transaction") : tr("Sent transaction") ) : tr("Incoming transaction"),
tr("Date: %1\n"
"Amount: %2\n"
"Type: %3\n"
Expand All @@ -1030,6 +1043,8 @@ void BitcoinGUI::incomingTransaction(const QString& date, int unit, const CAmoun
.arg(BitcoinUnits::formatWithUnit(unit, amount, true))
.arg(type)
.arg(address), CClientUIInterface::MSG_INFORMATION);

pwalletMain->fMultiSendNotify = false;
}
#endif // ENABLE_WALLET

Expand Down Expand Up @@ -1066,17 +1081,20 @@ bool BitcoinGUI::eventFilter(QObject *object, QEvent *event)

void BitcoinGUI::setStakingStatus()
{
if(pwalletMain)
fMultiSend = pwalletMain->fMultiSend;

if(nLastCoinStakeSearchInterval)
{
labelStakingIcon->show();
labelStakingIcon->setPixmap(QIcon(":/icons/staking_active").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelStakingIcon->setToolTip(tr("Staking is active"));
labelStakingIcon->setToolTip(tr("Staking is active\n MultiSend: %1").arg(fMultiSend ? tr("Active") : tr("Not Active")));
}
else
{
labelStakingIcon->show();
labelStakingIcon->setPixmap(QIcon(":/icons/staking_inactive").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelStakingIcon->setToolTip(tr("Staking is not active"));
labelStakingIcon->setToolTip(tr("Staking is not active\n MultiSend: %1").arg(fMultiSend ? tr("Active") : tr("Not Active")));
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/qt/bitcoingui.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ class BitcoinGUI : public QMainWindow
void removeAllWallets();
#endif // ENABLE_WALLET
bool enableWallet;
bool fMultiSend;
bool fMultiSendNotify;

protected:
void changeEvent(QEvent *e);
Expand Down Expand Up @@ -119,6 +121,7 @@ class BitcoinGUI : public QMainWindow
QAction *openAction;
QAction *openTradingwindowAction;
QAction *showHelpMessageAction;
QAction *multiSendAction;

QSystemTrayIcon *trayIcon;
QMenu *trayIconMenu;
Expand Down Expand Up @@ -206,9 +209,12 @@ private slots:
void gotoSignMessageTab(QString addr = "");
/** Show Sign/Verify Message dialog and switch to verify message tab */
void gotoVerifyMessageTab(QString addr = "");
/** Show MultiSend Dialog */
void gotoMultiSendDialog();

/** Show open dialog */
void openClicked();

#endif // ENABLE_WALLET
/** Show configuration dialog */
void optionsClicked();
Expand Down
Loading