mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-12 21:02:38 -03:00
Fix Qt test cases by moving address checks to parseBitcoinURI
Makes sense in case bitcoin URIs eventually allow invalid addresses as a part of some larger future payment scheme.
This commit is contained in:
parent
319236afa2
commit
2bc15836be
2 changed files with 4 additions and 6 deletions
|
@ -4,7 +4,6 @@
|
||||||
#include "bitcoinunits.h"
|
#include "bitcoinunits.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "base58.h"
|
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
@ -81,11 +80,6 @@ bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
|
||||||
if(uri.scheme() != QString("bitcoin"))
|
if(uri.scheme() != QString("bitcoin"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// check if the address is valid
|
|
||||||
CBitcoinAddress addressFromUri(uri.path().toStdString());
|
|
||||||
if (!addressFromUri.IsValid())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
SendCoinsRecipient rv;
|
SendCoinsRecipient rv;
|
||||||
rv.address = uri.path();
|
rv.address = uri.path();
|
||||||
rv.amount = 0;
|
rv.amount = 0;
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "sendcoinsentry.h"
|
#include "sendcoinsentry.h"
|
||||||
#include "guiutil.h"
|
#include "guiutil.h"
|
||||||
#include "askpassphrasedialog.h"
|
#include "askpassphrasedialog.h"
|
||||||
|
#include "base58.h"
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
|
@ -273,6 +274,9 @@ bool SendCoinsDialog::handleURI(const QString &uri)
|
||||||
// URI has to be valid
|
// URI has to be valid
|
||||||
if (GUIUtil::parseBitcoinURI(uri, &rv))
|
if (GUIUtil::parseBitcoinURI(uri, &rv))
|
||||||
{
|
{
|
||||||
|
CBitcoinAddress address(rv.address.toStdString());
|
||||||
|
if (!address.IsValid())
|
||||||
|
return false;
|
||||||
pasteEntry(rv);
|
pasteEntry(rv);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue