mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Chainparams: Adapt qt/paymentserver to support more than 2 chains
This commit is contained in:
parent
d16d076053
commit
cbb438cccc
1 changed files with 8 additions and 20 deletions
|
|
@ -221,16 +221,13 @@ void PaymentServer::ipcParseCommandLine(int argc, char* argv[])
|
|||
if (GUIUtil::parseBitcoinURI(arg, &r) && !r.address.isEmpty())
|
||||
{
|
||||
CBitcoinAddress address(r.address.toStdString());
|
||||
boost::scoped_ptr<CChainParams> tempChainParams(CChainParams::Factory(CBaseChainParams::MAIN));
|
||||
|
||||
if (address.IsValid(*tempChainParams))
|
||||
{
|
||||
SelectParams(CBaseChainParams::MAIN);
|
||||
}
|
||||
else {
|
||||
tempChainParams.reset(CChainParams::Factory(CBaseChainParams::TESTNET));
|
||||
if (address.IsValid(*tempChainParams))
|
||||
SelectParams(CBaseChainParams::TESTNET);
|
||||
std::map<std::string, uint256>::const_iterator iter;
|
||||
for (iter = CChainParams::supportedChains.begin(); iter != CChainParams::supportedChains.end(); ++iter) {
|
||||
boost::scoped_ptr<CChainParams> tempChainParams(CChainParams::Factory(iter->first));
|
||||
if (address.IsValid(*tempChainParams)) {
|
||||
SelectParams(iter->first);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -240,16 +237,7 @@ void PaymentServer::ipcParseCommandLine(int argc, char* argv[])
|
|||
|
||||
PaymentRequestPlus request;
|
||||
if (readPaymentRequestFromFile(arg, request))
|
||||
{
|
||||
if (request.getDetails().network() == "main")
|
||||
{
|
||||
SelectParams(CBaseChainParams::MAIN);
|
||||
}
|
||||
else if (request.getDetails().network() == "test")
|
||||
{
|
||||
SelectParams(CBaseChainParams::TESTNET);
|
||||
}
|
||||
}
|
||||
SelectParams(request.getDetails().network());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue