diff --git a/src/makefile.linux-mingw b/src/makefile.linux-mingw index fc22bb76ee6..51439c7b7c8 100644 --- a/src/makefile.linux-mingw +++ b/src/makefile.linux-mingw @@ -7,11 +7,12 @@ DEPSDIR:=/usr/i586-mingw32msvc USE_UPNP:=0 INCLUDEPATHS= \ + -I"$(CURDIR)" \ + -I"$(CURDIR)"/obj \ -I"$(DEPSDIR)/boost_1_49_0" \ -I"$(DEPSDIR)/db-4.8.30.NC/build_unix" \ -I"$(DEPSDIR)/openssl-1.0.1b/include" \ - -I"$(DEPSDIR)" \ - -I"$(CURDIR)"/obj \ + -I"$(DEPSDIR)" LIBPATHS= \ -L"$(DEPSDIR)/boost_1_49_0/stage/lib" \ @@ -88,7 +89,7 @@ obj-test/%.o: test/%.cpp $(HEADERS) i586-mingw32msvc-g++ -c $(TESTDEFS) $(CFLAGS) -o $@ $< test_bitcoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%)) - i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework $(LIBS) + i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework-mt-s $(LIBS) clean: diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 558eff6d5d7..d2d7716dbd7 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -4,7 +4,6 @@ #include "bitcoinunits.h" #include "util.h" #include "init.h" -#include "base58.h" #include #include @@ -81,11 +80,6 @@ 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; diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 2c46ea5a703..789681ad900 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -7,6 +7,7 @@ #include "sendcoinsentry.h" #include "guiutil.h" #include "askpassphrasedialog.h" +#include "base58.h" #include #include @@ -273,6 +274,9 @@ bool SendCoinsDialog::handleURI(const QString &uri) // URI has to be valid if (GUIUtil::parseBitcoinURI(uri, &rv)) { + CBitcoinAddress address(rv.address.toStdString()); + if (!address.IsValid()) + return false; pasteEntry(rv); return true; } diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp index 5b11e39ea37..af2d358fc47 100644 --- a/src/qt/test/test_main.cpp +++ b/src/qt/test/test_main.cpp @@ -6,6 +6,11 @@ // This is all you need to run all the tests int main(int argc, char *argv[]) { + bool fInvalid = false; + URITests test1; - QTest::qExec(&test1); + if (QTest::qExec(&test1) != 0) + fInvalid = true; + + return fInvalid; } diff --git a/src/qt/test/uritests.cpp b/src/qt/test/uritests.cpp index a281c39ca56..4662f5ed31c 100644 --- a/src/qt/test/uritests.cpp +++ b/src/qt/test/uritests.cpp @@ -47,7 +47,7 @@ void URITests::uriTests() uri.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=100&label=Wikipedia Example")); QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv)); QVERIFY(rv.address == QString("175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W")); - QVERIFY(rv.amount == 10000000000); + QVERIFY(rv.amount == 10000000000LL); QVERIFY(rv.label == QString("Wikipedia Example")); uri.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?message=Wikipedia Example Address"));