Skip to content

Commit 9707ca5

Browse files
codablockUdjinM6
authored andcommitted
Backport Bitcoin Qt/Gui changes up to 0.14.x part 2 (#1615)
* Merge bitcoin#7506: Use CCoinControl selection in CWallet::FundTransaction d6cc6a1 Use CCoinControl selection in CWallet::FundTransaction (João Barbosa) * Merge bitcoin#7732: [Qt] Debug window: replace "Build date" with "Datadir" fc737d1 [Qt] remove unused formatBuildDate method (Jonas Schnelli) 4856f1d [Qt] Debug window: replace "Build date" with "Datadir" (Jonas Schnelli) * Merge bitcoin#7707: [RPC][QT] UI support for abandoned transactions 8efed3b [Qt] Support for abandoned/abandoning transactions (Jonas Schnelli) * Merge bitcoin#7688: List solvability in listunspent output and improve help c3932b3 List solvability in listunspent output and improve help (Pieter Wuille) * Merge bitcoin#8006: Qt: Add option to disable the system tray icon 8b0e497 Qt: Add option to hide the system tray icon (Tyler Hardin) * Merge bitcoin#8073: qt: askpassphrasedialog: Clear pass fields on accept 02ce2a3 qt: askpassphrasedialog: Clear pass fields on accept (Pavel Vasin) * Merge bitcoin#8231: [Qt] fix a bug where the SplashScreen will not be hidden during startup b3e1348 [Qt] fix a bug where the SplashScreen will not be hidden during startup (Jonas Schnelli) * Merge bitcoin#8257: Do not ask a UI question from bitcoind 1acf1db Do not ask a UI question from bitcoind (Pieter Wuille) * Merge bitcoin#8463: [qt] Remove Priority from coincontrol dialog fa8dd78 [qt] Remove Priority from coincontrol dialog (MarcoFalke) * Merge bitcoin#8678: [Qt][CoinControl] fix UI bug that could result in paying unexpected fee 0480293 [Qt][CoinControl] fix UI bug that could result in paying unexpected fee (Jonas Schnelli) * Merge bitcoin#8672: Qt: Show transaction size in transaction details window c015634 qt: Adding transaction size to transaction details window (Hampus Sjöberg) \-- merge fix for s/size/total size/ fdf82fb Adding method GetTotalSize() to CTransaction (Hampus Sjöberg) * Merge bitcoin#8371: [Qt] Add out-of-sync modal info layer 08827df [Qt] modalinfolayer: removed unused comments, renamed signal, code style overhaul (Jonas Schnelli) d8b062e [Qt] only update "amount of blocks left" when the header chain is in-sync (Jonas Schnelli) e3245b4 [Qt] add out-of-sync modal info layer (Jonas Schnelli) e47052f [Qt] ClientModel add method to get the height of the header chain (Jonas Schnelli) a001f18 [Qt] Always pass the numBlocksChanged signal for headers tip changed (Jonas Schnelli) bd44a04 [Qt] make Out-Of-Sync warning icon clickable (Jonas Schnelli) 0904c3c [Refactor] refactor function that forms human readable text out of a timeoffset (Jonas Schnelli) * Merge bitcoin#8805: Trivial: Grammar and capitalization c9ce17b Trivial: Grammar and capitalization (Derek Miller) * Merge bitcoin#8885: gui: fix ban from qt console cb78c60 gui: fix ban from qt console (Cory Fields) * Merge bitcoin#8821: [qt] sync-overlay: Don't block during reindex fa85e86 [qt] sync-overlay: Don't show estimated number of headers left (MarcoFalke) faa4de2 [qt] sync-overlay: Don't block during reindex (MarcoFalke) * Support themes for new transaction_abandoned icon * Fix constructor call to COutput * Merge bitcoin#7842: RPC: do not print minping time in getpeerinfo when no ping received yet 62a6486 RPC: do not print ping info in getpeerinfo when no ping received yet, fix help (Pavel Janík) * Merge bitcoin#8918: Qt: Add "Copy URI" to payment request context menu 21f5a63 Qt: Add "Copy URI" to payment request context menu (Luke Dashjr) * Merge bitcoin#8925: qt: Display minimum ping in debug window. 1724a40 Display minimum ping in debug window. (R E Broadley) * Merge bitcoin#8972: [Qt] make warnings label selectable (jonasschnelli) ef0c9ee [Qt] make warnings label selectable (Jonas Schnelli) * Make background of warning icon transparent in modaloverlay * Merge bitcoin#9088: Reduce ambiguity of warning message 77cbbd9 Make warning message about wallet balance possibly being incorrect less ambiguous. (R E Broadley) * Replace Bitcoin with Dash in modal overlay * Remove clicked signals from labelWalletStatus and labelTransactionsStatus As both are really just labels, clicking on those is not possible. This is different in Bitcoin, where these labels are actually buttons. * Pull out modaloverlay show/hide into it's own if/else block and switch to time based check Also don't use masternodeSync.IsBlockchainSynced() for now as it won't report the blockchain being synced before the first block (or other MN data?) arrives. This would otherwise give the impression that sync is being stuck.
1 parent 690cb58 commit 9707ca5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1083
-278
lines changed

src/Makefile.qt.include

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ QT_FORMS_UI = \
2828
qt/forms/editaddressdialog.ui \
2929
qt/forms/helpmessagedialog.ui \
3030
qt/forms/intro.ui \
31+
qt/forms/modaloverlay.ui \
3132
qt/forms/masternodelist.ui \
3233
qt/forms/openuridialog.ui \
3334
qt/forms/optionsdialog.ui \
@@ -59,6 +60,7 @@ QT_MOC_CPP = \
5960
qt/moc_intro.cpp \
6061
qt/moc_macdockiconhandler.cpp \
6162
qt/moc_macnotificationhandler.cpp \
63+
qt/moc_modaloverlay.cpp \
6264
qt/moc_masternodelist.cpp \
6365
qt/moc_notificator.cpp \
6466
qt/moc_openuridialog.cpp \
@@ -128,6 +130,7 @@ BITCOIN_QT_H = \
128130
qt/intro.h \
129131
qt/macdockiconhandler.h \
130132
qt/macnotificationhandler.h \
133+
qt/modaloverlay.h \
131134
qt/masternodelist.h \
132135
qt/networkstyle.h \
133136
qt/notificator.h \
@@ -168,6 +171,7 @@ RES_ICONS = \
168171
qt/res/icons/bitcoin.ico \
169172
qt/res/icons/bitcoin.png \
170173
qt/res/icons/chevron.png \
174+
qt/res/icons/warning.png \
171175
qt/res/icons/drkblue/add.png \
172176
qt/res/icons/drkblue/address-book.png \
173177
qt/res/icons/drkblue/browse.png \
@@ -220,6 +224,7 @@ RES_ICONS = \
220224
qt/res/icons/drkblue/verify.png \
221225
qt/res/icons/drkblue/fontbigger.png \
222226
qt/res/icons/drkblue/fontsmaller.png \
227+
qt/res/icons/drkblue/transaction_abandoned.png \
223228
qt/res/icons/crownium/add.png \
224229
qt/res/icons/crownium/address-book.png \
225230
qt/res/icons/crownium/browse.png \
@@ -272,6 +277,7 @@ RES_ICONS = \
272277
qt/res/icons/crownium/verify.png \
273278
qt/res/icons/crownium/fontbigger.png \
274279
qt/res/icons/crownium/fontsmaller.png \
280+
qt/res/icons/crownium/transaction_abandoned.png \
275281
qt/res/icons/light/add.png \
276282
qt/res/icons/light/address-book.png \
277283
qt/res/icons/light/browse.png \
@@ -324,6 +330,7 @@ RES_ICONS = \
324330
qt/res/icons/light/verify.png \
325331
qt/res/icons/light/fontbigger.png \
326332
qt/res/icons/light/fontsmaller.png \
333+
qt/res/icons/light/transaction_abandoned.png \
327334
qt/res/icons/trad/add.png \
328335
qt/res/icons/trad/address-book.png \
329336
qt/res/icons/trad/browse.png \
@@ -375,7 +382,8 @@ RES_ICONS = \
375382
qt/res/icons/trad/about_qt.png \
376383
qt/res/icons/trad/verify.png \
377384
qt/res/icons/trad/fontbigger.png \
378-
qt/res/icons/trad/fontsmaller.png
385+
qt/res/icons/trad/fontsmaller.png \
386+
qt/res/icons/trad/transaction_abandoned.png
379387

380388
BITCOIN_QT_CPP = \
381389
qt/bantablemodel.cpp \
@@ -387,6 +395,7 @@ BITCOIN_QT_CPP = \
387395
qt/csvmodelwriter.cpp \
388396
qt/guiutil.cpp \
389397
qt/intro.cpp \
398+
qt/modaloverlay.cpp \
390399
qt/networkstyle.cpp \
391400
qt/notificator.cpp \
392401
qt/optionsdialog.cpp \

src/coincontrol.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@ class CCoinControl
4242
return (setSelected.size() > 0);
4343
}
4444

45-
bool IsSelected(const uint256& hash, unsigned int n) const
45+
bool IsSelected(const COutPoint& output) const
4646
{
47-
COutPoint outpt(hash, n);
48-
return (setSelected.count(outpt) > 0);
47+
return (setSelected.count(output) > 0);
4948
}
5049

5150
void Select(const COutPoint& output)

src/init.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1613,8 +1613,9 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
16131613
if (!fLoaded) {
16141614
// first suggest a reindex
16151615
if (!fReset) {
1616-
bool fRet = uiInterface.ThreadSafeMessageBox(
1616+
bool fRet = uiInterface.ThreadSafeQuestion(
16171617
strLoadError + ".\n\n" + _("Do you want to rebuild the block database now?"),
1618+
strLoadError + ".\nPlease restart with -reindex or -reindex-chainstate to recover.",
16181619
"", CClientUIInterface::MSG_ERROR | CClientUIInterface::BTN_ABORT);
16191620
if (fRet) {
16201621
fReindex = true;

src/net.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ void CNode::copyStats(CNodeStats &stats)
630630
{
631631
stats.nodeid = this->GetId();
632632
X(nServices);
633+
X(addr);
633634
X(fRelayTxes);
634635
X(nLastSend);
635636
X(nLastRecv);
@@ -659,7 +660,7 @@ void CNode::copyStats(CNodeStats &stats)
659660

660661
// Raw ping time is in microseconds, but show it to user as whole seconds (Dash users should be well used to small numbers with many decimal places by now :)
661662
stats.dPingTime = (((double)nPingUsecTime) / 1e6);
662-
stats.dPingMin = (((double)nMinPingUsecTime) / 1e6);
663+
stats.dMinPing = (((double)nMinPingUsecTime) / 1e6);
663664
stats.dPingWait = (((double)nPingUsecWait) / 1e6);
664665

665666
// Leave string empty if addrLocal invalid (not filled in yet)

src/net.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,9 @@ class CNodeStats
607607
bool fWhitelisted;
608608
double dPingTime;
609609
double dPingWait;
610-
double dPingMin;
610+
double dMinPing;
611611
std::string addrLocal;
612+
CAddress addr;
612613
};
613614

614615

src/noui.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ static bool noui_ThreadSafeMessageBox(const std::string& message, const std::str
4040
return false;
4141
}
4242

43+
static bool noui_ThreadSafeQuestion(const std::string& /* ignored interactive message */, const std::string& message, const std::string& caption, unsigned int style)
44+
{
45+
return noui_ThreadSafeMessageBox(message, caption, style);
46+
}
47+
4348
static void noui_InitMessage(const std::string& message)
4449
{
4550
LogPrintf("init message: %s\n", message);
@@ -49,5 +54,6 @@ void noui_connect()
4954
{
5055
// Connect dashd signal handlers
5156
uiInterface.ThreadSafeMessageBox.connect(noui_ThreadSafeMessageBox);
57+
uiInterface.ThreadSafeQuestion.connect(noui_ThreadSafeQuestion);
5258
uiInterface.InitMessage.connect(noui_InitMessage);
5359
}

src/primitives/transaction.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ unsigned int CTransaction::CalculateModifiedSize(unsigned int nTxSize) const
147147
return nTxSize;
148148
}
149149

150+
unsigned int CTransaction::GetTotalSize() const
151+
{
152+
return ::GetSerializeSize(*this, SER_NETWORK, PROTOCOL_VERSION);
153+
}
154+
150155
std::string CTransaction::ToString() const
151156
{
152157
std::string str;

src/primitives/transaction.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,13 @@ class CTransaction
273273

274274
// Compute modified tx size for priority calculation (optionally given tx size)
275275
unsigned int CalculateModifiedSize(unsigned int nTxSize=0) const;
276+
277+
/**
278+
* Get the total transaction size in bytes, including witness data.
279+
* "Total Size" defined in BIP141 and BIP144.
280+
* @return Total transaction size in bytes
281+
*/
282+
unsigned int GetTotalSize() const;
276283

277284
bool IsCoinBase() const
278285
{

src/qt/askpassphrasedialog.cpp

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,7 @@ AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent) :
7777

7878
AskPassphraseDialog::~AskPassphraseDialog()
7979
{
80-
// Attempt to overwrite text so that they do not linger around in memory
81-
ui->passEdit1->setText(QString(" ").repeated(ui->passEdit1->text().size()));
82-
ui->passEdit2->setText(QString(" ").repeated(ui->passEdit2->text().size()));
83-
ui->passEdit3->setText(QString(" ").repeated(ui->passEdit3->text().size()));
80+
secureClearPassFields();
8481
delete ui;
8582
}
8683

@@ -103,6 +100,8 @@ void AskPassphraseDialog::accept()
103100
newpass1.assign(ui->passEdit2->text().toStdString().c_str());
104101
newpass2.assign(ui->passEdit3->text().toStdString().c_str());
105102

103+
secureClearPassFields();
104+
106105
switch(mode)
107106
{
108107
case Encrypt: {
@@ -262,3 +261,17 @@ bool AskPassphraseDialog::eventFilter(QObject *object, QEvent *event)
262261
}
263262
return QDialog::eventFilter(object, event);
264263
}
264+
265+
static void SecureClearQLineEdit(QLineEdit* edit)
266+
{
267+
// Attempt to overwrite text so that they do not linger around in memory
268+
edit->setText(QString(" ").repeated(edit->text().size()));
269+
edit->clear();
270+
}
271+
272+
void AskPassphraseDialog::secureClearPassFields()
273+
{
274+
SecureClearQLineEdit(ui->passEdit1);
275+
SecureClearQLineEdit(ui->passEdit2);
276+
SecureClearQLineEdit(ui->passEdit3);
277+
}

src/qt/askpassphrasedialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class AskPassphraseDialog : public QDialog
4343

4444
private Q_SLOTS:
4545
void textChanged();
46+
void secureClearPassFields();
4647

4748
protected:
4849
bool event(QEvent *event);

0 commit comments

Comments
 (0)