mirror of
https://github.com/wownero/wownero.git
synced 2026-10-21 17:38:33 +02:00
simplewallet: reject donations when not on mainnet
This commit is contained in:
@@ -7427,28 +7427,14 @@ bool simple_wallet::donate(const std::vector<std::string> &args_)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// push back address, amount
|
// push back address, amount
|
||||||
std::string address_str;
|
|
||||||
if (m_wallet->nettype() != cryptonote::MAINNET)
|
if (m_wallet->nettype() != cryptonote::MAINNET)
|
||||||
{
|
{
|
||||||
// if not mainnet, convert donation address string to the relevant network type
|
fail_msg_writer() << tr("Donations are supported on mainnet only.");
|
||||||
address_parse_info info;
|
return true;
|
||||||
if (!cryptonote::get_account_address_from_str(info, cryptonote::MAINNET, MONERO_DONATION_ADDR))
|
|
||||||
{
|
|
||||||
fail_msg_writer() << tr("Failed to parse donation address: ") << MONERO_DONATION_ADDR;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
address_str = cryptonote::get_account_address_as_str(m_wallet->nettype(), info.is_subaddress, info.address);
|
|
||||||
}
|
}
|
||||||
else
|
local_args.push_back(MONERO_DONATION_ADDR);
|
||||||
{
|
|
||||||
address_str = MONERO_DONATION_ADDR;
|
|
||||||
}
|
|
||||||
local_args.push_back(address_str);
|
|
||||||
local_args.push_back(amount_str);
|
local_args.push_back(amount_str);
|
||||||
if (m_wallet->nettype() == cryptonote::MAINNET)
|
message_writer() << (boost::format(tr("Donating %s %s to The Monero Project (donate.getmonero.org or %s).")) % amount_str % cryptonote::get_unit(cryptonote::get_default_decimal_point()) % MONERO_DONATION_ADDR).str();
|
||||||
message_writer() << (boost::format(tr("Donating %s %s to The Monero Project (donate.getmonero.org or %s).")) % amount_str % cryptonote::get_unit(cryptonote::get_default_decimal_point()) % MONERO_DONATION_ADDR).str();
|
|
||||||
else
|
|
||||||
message_writer() << (boost::format(tr("Donating %s %s to %s.")) % amount_str % cryptonote::get_unit(cryptonote::get_default_decimal_point()) % address_str).str();
|
|
||||||
transfer(local_args);
|
transfer(local_args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user