aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2014-06-11 12:23:49 +0200
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2014-06-12 13:19:12 +0200
commitf5ae6c98260fdd3c0ca203ce67c6467d9cdaea95 (patch)
tree44b49c1f22f9c9ec6ec0ea9aede291b17112595b /src/qt
parent3f39b9d4551d729c3a2e4decd810ac6887cfaeb3 (diff)
add NetworkIDString() to chainparams
- returns the BIP70 network string - use that new function in the core and GUI code and remove unused code and functions
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/clientmodel.cpp8
-rw-r--r--src/qt/clientmodel.h2
-rw-r--r--src/qt/paymentserver.cpp13
-rw-r--r--src/qt/paymentserver.h1
-rw-r--r--src/qt/rpcconsole.cpp2
5 files changed, 2 insertions, 24 deletions
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index 403b03378f..9c9565be67 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -142,14 +142,6 @@ void ClientModel::updateAlert(const QString &hash, int status)
emit alertsChanged(getStatusBarWarnings());
}
-QString ClientModel::getNetworkName() const
-{
- QString netname(QString::fromStdString(Params().DataDir()));
- if(netname.isEmpty())
- netname = "main";
- return netname;
-}
-
bool ClientModel::inInitialBlockDownload() const
{
return IsInitialBlockDownload();
diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h
index 9c9a35b654..c7bd60bd41 100644
--- a/src/qt/clientmodel.h
+++ b/src/qt/clientmodel.h
@@ -56,8 +56,6 @@ public:
double getVerificationProgress() const;
QDateTime getLastBlockDate() const;
- //! Return network (main, testnet3, regtest)
- QString getNetworkName() const;
//! Return true if core is doing initial block download
bool inInitialBlockDownload() const;
//! Return true if core is importing blocks
diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp
index 9241f9dc3c..eb6ab879aa 100644
--- a/src/qt/paymentserver.cpp
+++ b/src/qt/paymentserver.cpp
@@ -490,17 +490,6 @@ bool PaymentServer::readPaymentRequest(const QString& filename, PaymentRequestPl
return request.parse(data);
}
-std::string PaymentServer::mapNetworkIdToName(CChainParams::Network networkId)
-{
- if (networkId == CChainParams::MAIN)
- return "main";
- if (networkId == CChainParams::TESTNET)
- return "test";
- if (networkId == CChainParams::REGTEST)
- return "regtest";
- return "";
-}
-
bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, SendCoinsRecipient& recipient)
{
if (!optionsModel)
@@ -510,7 +499,7 @@ bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, SendCoins
const payments::PaymentDetails& details = request.getDetails();
// Payment request network matches client network?
- if (details.network() != mapNetworkIdToName(Params().NetworkID()))
+ if (details.network() != Params().NetworkIDString())
{
emit message(tr("Payment request rejected"), tr("Payment request network doesn't match client network."),
CClientUIInterface::MSG_ERROR);
diff --git a/src/qt/paymentserver.h b/src/qt/paymentserver.h
index d6949a47ce..d84d09c57d 100644
--- a/src/qt/paymentserver.h
+++ b/src/qt/paymentserver.h
@@ -118,7 +118,6 @@ protected:
private:
static bool readPaymentRequest(const QString& filename, PaymentRequestPlus& request);
- std::string mapNetworkIdToName(CChainParams::Network networkId);
bool processPaymentRequest(PaymentRequestPlus& request, SendCoinsRecipient& recipient);
void fetchRequest(const QUrl& url);
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index 199050cc57..f7491f4a42 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -316,7 +316,7 @@ void RPCConsole::setClientModel(ClientModel *model)
ui->buildDate->setText(model->formatBuildDate());
ui->startupTime->setText(model->formatClientStartupTime());
- ui->networkName->setText(model->getNetworkName());
+ ui->networkName->setText(QString::fromStdString(Params().NetworkIDString()));
}
}