aboutsummaryrefslogtreecommitdiff
path: root/src/qt/paymentserver.cpp
diff options
context:
space:
mode:
authorRoss Nicoll <[email protected]>2018-01-20 17:42:00 +0000
committerRoss Nicoll <[email protected]>2018-09-19 22:11:47 +0100
commit5618d8497a4cdb7a454e04e8563353bb7db124ce (patch)
treecafa3371b8e155badfd5e525f3315fd9abbcb414 /src/qt/paymentserver.cpp
parentAdd block height to block notification substitution options (#1430) (diff)
downloaddiscoin-5618d8497a4cdb7a454e04e8563353bb7db124ce.tar.xz
discoin-5618d8497a4cdb7a454e04e8563353bb7db124ce.zip
Update payment protocol to match Dogecoin (#1433)
* Revised payment request handling to use genesis block hash instead of network name, enabling support for more networks that just Bitcoin main and test net. * Disable payment protocol certificate unit tests; we don't modify this code, and regenerating the test data is likely to be significantly time consuming. Will re-enable once discussion on spec is concluded.
Diffstat (limited to 'src/qt/paymentserver.cpp')
-rw-r--r--src/qt/paymentserver.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp
index dd75f1207..fd54591a7 100644
--- a/src/qt/paymentserver.cpp
+++ b/src/qt/paymentserver.cpp
@@ -237,11 +237,11 @@ void PaymentServer::ipcParseCommandLine(int argc, char* argv[])
PaymentRequestPlus request;
if (readPaymentRequestFromFile(arg, request))
{
- if (request.getDetails().network() == "main")
+ if (request.getDetails().genesis() == "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691")
{
SelectParams(CBaseChainParams::MAIN);
}
- else if (request.getDetails().network() == "test")
+ else if (request.getDetails().genesis() == "bb0a78264637406b6360aad926284d544d7049f45189db5664f3c4d07350559e")
{
SelectParams(CBaseChainParams::TESTNET);
}
@@ -760,12 +760,13 @@ void PaymentServer::handlePaymentACK(const QString& paymentACKMsg)
bool PaymentServer::verifyNetwork(const payments::PaymentDetails& requestDetails)
{
- bool fVerified = requestDetails.network() == Params().NetworkIDString();
+ Consensus::Params consensus = Params().GetConsensus(0);
+ bool fVerified = requestDetails.genesis() == consensus.hashGenesisBlock.GetHex();
if (!fVerified) {
qWarning() << QString("PaymentServer::%1: Payment request network \"%2\" doesn't match client network \"%3\".")
.arg(__func__)
- .arg(QString::fromStdString(requestDetails.network()))
- .arg(QString::fromStdString(Params().NetworkIDString()));
+ .arg(QString::fromStdString(requestDetails.genesis()))
+ .arg(QString::fromStdString(consensus.hashGenesisBlock.GetHex()));
}
return fVerified;
}