Merge pull request #3824
f0a83fcUse Params().NetworkID() instead of TestNet() from the payment protocol (jtimon)2871889net.h was using std namespace through chainparams.h included in protocol.h (jtimon)c8c52deReplace virtual methods with static attributes, chainparams.h depends on protocol.h instead of the other way around (jtimon)a3d946eGet rid of TestNet() (jtimon)6fc0fa6Add RPCisTestNet chain parameter (jtimon)cfeb823Add RequireStandard chain parameter (jtimon)21913a9Add AllowMinDifficultyBlocks chain parameter (jtimon)d754f34Move majority constants to chainparams (jtimon)8d26721Get rid of RegTest() (jtimon)cb9bd83Add DefaultCheckMemPool chain parameter (jtimon)2595b9aAdd DefaultMinerThreads chain parameter (jtimon)bfa9a1aAdd MineBlocksOnDemand chain parameter (jtimon)1712adbAdd MiningRequiresPeers chain parameter (jtimon)
This commit is contained in:
@@ -490,6 +490,17 @@ 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)
|
||||
@@ -499,8 +510,7 @@ bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, SendCoins
|
||||
const payments::PaymentDetails& details = request.getDetails();
|
||||
|
||||
// Payment request network matches client network?
|
||||
if ((details.network() == "main" && TestNet()) ||
|
||||
(details.network() == "test" && !TestNet()))
|
||||
if (details.network() != mapNetworkIdToName(Params().NetworkID()))
|
||||
{
|
||||
emit message(tr("Payment request rejected"), tr("Payment request network doesn't match client network."),
|
||||
CClientUIInterface::MSG_ERROR);
|
||||
|
||||
Reference in New Issue
Block a user