mirror of
https://github.com/jwinterm/myriadcoin.git
synced 2026-10-20 06:08:43 +02:00
Initial Zetacoin checkin
This commit is contained in:
+22
-22
@@ -96,7 +96,7 @@ Value getnewaddress(const Array& params, bool fHelp)
|
||||
if (fHelp || params.size() > 1)
|
||||
throw runtime_error(
|
||||
"getnewaddress [account]\n"
|
||||
"Returns a new Bitcoin address for receiving payments. "
|
||||
"Returns a new Zetacoin address for receiving payments. "
|
||||
"If [account] is specified (recommended), it is added to the address book "
|
||||
"so payments received with the address will be credited to [account].");
|
||||
|
||||
@@ -163,7 +163,7 @@ Value getaccountaddress(const Array& params, bool fHelp)
|
||||
if (fHelp || params.size() != 1)
|
||||
throw runtime_error(
|
||||
"getaccountaddress <account>\n"
|
||||
"Returns the current Bitcoin address for receiving payments to this account.");
|
||||
"Returns the current Zetacoin address for receiving payments to this account.");
|
||||
|
||||
// Parse the account first so we don't generate a key if there's an error
|
||||
string strAccount = AccountFromValue(params[0]);
|
||||
@@ -181,12 +181,12 @@ Value setaccount(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() < 1 || params.size() > 2)
|
||||
throw runtime_error(
|
||||
"setaccount <bitcoinaddress> <account>\n"
|
||||
"setaccount <zetacoinaddress> <account>\n"
|
||||
"Sets the account associated with the given address.");
|
||||
|
||||
CBitcoinAddress address(params[0].get_str());
|
||||
if (!address.IsValid())
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address");
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Zetacoin address");
|
||||
|
||||
|
||||
string strAccount;
|
||||
@@ -211,12 +211,12 @@ Value getaccount(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() != 1)
|
||||
throw runtime_error(
|
||||
"getaccount <bitcoinaddress>\n"
|
||||
"getaccount <zetacoinaddress>\n"
|
||||
"Returns the account associated with the given address.");
|
||||
|
||||
CBitcoinAddress address(params[0].get_str());
|
||||
if (!address.IsValid())
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address");
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Zetacoin address");
|
||||
|
||||
string strAccount;
|
||||
map<CTxDestination, string>::iterator mi = pwalletMain->mapAddressBook.find(address.Get());
|
||||
@@ -251,13 +251,13 @@ Value sendtoaddress(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() < 2 || params.size() > 4)
|
||||
throw runtime_error(
|
||||
"sendtoaddress <bitcoinaddress> <amount> [comment] [comment-to]\n"
|
||||
"sendtoaddress <zetacoinaddress> <amount> [comment] [comment-to]\n"
|
||||
"<amount> is a real and is rounded to the nearest 0.00000001"
|
||||
+ HelpRequiringPassphrase());
|
||||
|
||||
CBitcoinAddress address(params[0].get_str());
|
||||
if (!address.IsValid())
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address");
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Zetacoin address");
|
||||
|
||||
// Amount
|
||||
int64 nAmount = AmountFromValue(params[1]);
|
||||
@@ -314,7 +314,7 @@ Value signmessage(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() != 2)
|
||||
throw runtime_error(
|
||||
"signmessage <bitcoinaddress> <message>\n"
|
||||
"signmessage <zetacoinaddress> <message>\n"
|
||||
"Sign a message with the private key of an address");
|
||||
|
||||
EnsureWalletIsUnlocked();
|
||||
@@ -349,7 +349,7 @@ Value verifymessage(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() != 3)
|
||||
throw runtime_error(
|
||||
"verifymessage <bitcoinaddress> <signature> <message>\n"
|
||||
"verifymessage <zetacoinaddress> <signature> <message>\n"
|
||||
"Verify a signed message");
|
||||
|
||||
string strAddress = params[0].get_str();
|
||||
@@ -386,14 +386,14 @@ Value getreceivedbyaddress(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() < 1 || params.size() > 2)
|
||||
throw runtime_error(
|
||||
"getreceivedbyaddress <bitcoinaddress> [minconf=1]\n"
|
||||
"Returns the total amount received by <bitcoinaddress> in transactions with at least [minconf] confirmations.");
|
||||
"getreceivedbyaddress <zetacoinaddress> [minconf=1]\n"
|
||||
"Returns the total amount received by <zetacoinaddress> in transactions with at least [minconf] confirmations.");
|
||||
|
||||
// Bitcoin address
|
||||
CBitcoinAddress address = CBitcoinAddress(params[0].get_str());
|
||||
CScript scriptPubKey;
|
||||
if (!address.IsValid())
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address");
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Zetacoin address");
|
||||
scriptPubKey.SetDestination(address.Get());
|
||||
if (!IsMine(*pwalletMain,scriptPubKey))
|
||||
return (double)0.0;
|
||||
@@ -607,14 +607,14 @@ Value sendfrom(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() < 3 || params.size() > 6)
|
||||
throw runtime_error(
|
||||
"sendfrom <fromaccount> <tobitcoinaddress> <amount> [minconf=1] [comment] [comment-to]\n"
|
||||
"sendfrom <fromaccount> <tozetacoinaddress> <amount> [minconf=1] [comment] [comment-to]\n"
|
||||
"<amount> is a real and is rounded to the nearest 0.00000001"
|
||||
+ HelpRequiringPassphrase());
|
||||
|
||||
string strAccount = AccountFromValue(params[0]);
|
||||
CBitcoinAddress address(params[1].get_str());
|
||||
if (!address.IsValid())
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address");
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Zetacoin address");
|
||||
int64 nAmount = AmountFromValue(params[2]);
|
||||
int nMinDepth = 1;
|
||||
if (params.size() > 3)
|
||||
@@ -670,7 +670,7 @@ Value sendmany(const Array& params, bool fHelp)
|
||||
{
|
||||
CBitcoinAddress address(s.name_);
|
||||
if (!address.IsValid())
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid Bitcoin address: ")+s.name_);
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid Zetacoin address: ")+s.name_);
|
||||
|
||||
if (setAddress.count(address))
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+s.name_);
|
||||
@@ -725,7 +725,7 @@ static CScript _createmultisig(const Array& params)
|
||||
{
|
||||
const std::string& ks = keys[i].get_str();
|
||||
|
||||
// Case 1: Bitcoin address and we have full public key:
|
||||
// Case 1: Zetacoin address and we have full public key:
|
||||
CBitcoinAddress address(ks);
|
||||
if (address.IsValid())
|
||||
{
|
||||
@@ -766,7 +766,7 @@ Value addmultisigaddress(const Array& params, bool fHelp)
|
||||
{
|
||||
string msg = "addmultisigaddress <nrequired> <'[\"key\",\"key\"]'> [account]\n"
|
||||
"Add a nrequired-to-sign multisignature address to the wallet\"\n"
|
||||
"each key is a Bitcoin address or hex-encoded public key\n"
|
||||
"each key is a Zetacoin address or hex-encoded public key\n"
|
||||
"If [account] is specified, assign address to [account].";
|
||||
throw runtime_error(msg);
|
||||
}
|
||||
@@ -791,7 +791,7 @@ Value createmultisig(const Array& params, bool fHelp)
|
||||
string msg = "createmultisig <nrequired> <'[\"key\",\"key\"]'>\n"
|
||||
"Creates a multi-signature address and returns a json object\n"
|
||||
"with keys:\n"
|
||||
"address : bitcoin address\n"
|
||||
"address : zetacoin address\n"
|
||||
"redeemScript : hex-encoded redemption script";
|
||||
throw runtime_error(msg);
|
||||
}
|
||||
@@ -1401,7 +1401,7 @@ Value encryptwallet(const Array& params, bool fHelp)
|
||||
// slack space in .dat files; that is bad if the old data is
|
||||
// unencrypted private keys. So:
|
||||
StartShutdown();
|
||||
return "wallet encrypted; Bitcoin server stopping, restart to run with encrypted wallet. The keypool has been flushed, you need to make a new backup.";
|
||||
return "wallet encrypted; Zetacoin server stopping, restart to run with encrypted wallet. The keypool has been flushed, you need to make a new backup.";
|
||||
}
|
||||
|
||||
class DescribeAddressVisitor : public boost::static_visitor<Object>
|
||||
@@ -1443,8 +1443,8 @@ Value validateaddress(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() != 1)
|
||||
throw runtime_error(
|
||||
"validateaddress <bitcoinaddress>\n"
|
||||
"Return information about <bitcoinaddress>.");
|
||||
"validateaddress <zetacoinaddress>\n"
|
||||
"Return information about <zetacoinaddress>.");
|
||||
|
||||
CBitcoinAddress address(params[0].get_str());
|
||||
bool isValid = address.IsValid();
|
||||
|
||||
Reference in New Issue
Block a user