diff options
author | Philip Kaufmann <phil.kaufmann@t-online.de> | 2012-03-28 14:55:29 +0200 |
---|---|---|
committer | Philip Kaufmann <phil.kaufmann@t-online.de> | 2012-06-14 07:59:27 +0200 |
commit | 93b7af309904e68d8b7b2f6bdd2b9bcfb18f9e24 (patch) | |
tree | 56f207b07989d0dd4950419990c4db760f228870 /src/qt/guiutil.cpp | |
parent | 7a98f19fb6e40e2929abfff6b1f20f13c091d32d (diff) |
URI-handling code update: added safety checks and tray-notifications
Diffstat (limited to 'src/qt/guiutil.cpp')
-rw-r--r-- | src/qt/guiutil.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 5dedc90d69..a8c2328853 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -4,6 +4,7 @@ #include "bitcoinunits.h" #include "util.h" #include "init.h" +#include "base58.h" #include <QString> #include <QDateTime> @@ -80,6 +81,11 @@ bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out) if(uri.scheme() != QString("bitcoin")) return false; + // check if the address is valid + CBitcoinAddress addressFromUri(uri.path().toStdString()); + if (!addressFromUri.IsValid()) + return false; + SendCoinsRecipient rv; rv.address = uri.path(); rv.amount = 0; @@ -222,19 +228,18 @@ Qt::ConnectionType blockingGUIThreadConnection() bool checkPoint(const QPoint &p, const QWidget *w) { - QWidget *atW = qApp->widgetAt(w->mapToGlobal(p)); - if(!atW) return false; - return atW->topLevelWidget() == w; + QWidget *atW = qApp->widgetAt(w->mapToGlobal(p)); + if (!atW) return false; + return atW->topLevelWidget() == w; } bool isObscured(QWidget *w) { - - return !(checkPoint(QPoint(0, 0), w) - && checkPoint(QPoint(w->width() - 1, 0), w) - && checkPoint(QPoint(0, w->height() - 1), w) - && checkPoint(QPoint(w->width() - 1, w->height() - 1), w) - && checkPoint(QPoint(w->width()/2, w->height()/2), w)); + return !(checkPoint(QPoint(0, 0), w) + && checkPoint(QPoint(w->width() - 1, 0), w) + && checkPoint(QPoint(0, w->height() - 1), w) + && checkPoint(QPoint(w->width() - 1, w->height() - 1), w) + && checkPoint(QPoint(w->width() / 2, w->height() / 2), w)); } void openDebugLogfile() |