From f5ae6c98260fdd3c0ca203ce67c6467d9cdaea95 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 11 Jun 2014 12:23:49 +0200 Subject: 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 --- src/qt/paymentserver.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'src/qt/paymentserver.cpp') 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); -- cgit v1.2.3