Merge branch 'beta' into dev
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include "tinyformat.h"
|
#include "tinyformat.h"
|
||||||
|
|
||||||
const std::string CURRENCY_UNIT = "ZEC";
|
const std::string CURRENCY_UNIT = "KMD";
|
||||||
|
|
||||||
CFeeRate::CFeeRate(const CAmount& nFeePaid, size_t nSize)
|
CFeeRate::CFeeRate(const CAmount& nFeePaid, size_t nSize)
|
||||||
{
|
{
|
||||||
|
|||||||
29
src/main.cpp
29
src/main.cpp
@@ -3810,9 +3810,7 @@ bool CheckBlock(int32_t *futureblockp,int32_t height,CBlockIndex *pindex,const C
|
|||||||
uint8_t pubkey33[33]; uint256 hash;
|
uint8_t pubkey33[33]; uint256 hash;
|
||||||
// These are checks that are independent of context.
|
// These are checks that are independent of context.
|
||||||
hash = block.GetHash();
|
hash = block.GetHash();
|
||||||
|
// Check that the header is valid (particularly PoW). This is mostly redundant with the call in AcceptBlockHeader.
|
||||||
// Check that the header is valid (particularly PoW). This is mostly
|
|
||||||
// redundant with the call in AcceptBlockHeader.
|
|
||||||
if (!CheckBlockHeader(futureblockp,height,pindex,block,state,fCheckPOW))
|
if (!CheckBlockHeader(futureblockp,height,pindex,block,state,fCheckPOW))
|
||||||
{
|
{
|
||||||
if ( *futureblockp == 0 )
|
if ( *futureblockp == 0 )
|
||||||
@@ -3996,16 +3994,13 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//static uint256 komodo_requestedhash;
|
|
||||||
//static int32_t komodo_requestedcount;
|
|
||||||
|
|
||||||
bool AcceptBlockHeader(int32_t *futureblockp,const CBlockHeader& block, CValidationState& state, CBlockIndex** ppindex)
|
bool AcceptBlockHeader(int32_t *futureblockp,const CBlockHeader& block, CValidationState& state, CBlockIndex** ppindex)
|
||||||
{
|
{
|
||||||
static uint256 zero;
|
static uint256 zero;
|
||||||
const CChainParams& chainparams = Params();
|
const CChainParams& chainparams = Params();
|
||||||
AssertLockHeld(cs_main);
|
AssertLockHeld(cs_main);
|
||||||
|
|
||||||
// Check for duplicate
|
// Check for duplicate
|
||||||
uint256 hash = block.GetHash();
|
uint256 hash = block.GetHash();
|
||||||
BlockMap::iterator miSelf = mapBlockIndex.find(hash);
|
BlockMap::iterator miSelf = mapBlockIndex.find(hash);
|
||||||
CBlockIndex *pindex = NULL;
|
CBlockIndex *pindex = NULL;
|
||||||
@@ -4044,12 +4039,6 @@ bool AcceptBlockHeader(int32_t *futureblockp,const CBlockHeader& block, CValidat
|
|||||||
BlockMap::iterator mi = mapBlockIndex.find(block.hashPrevBlock);
|
BlockMap::iterator mi = mapBlockIndex.find(block.hashPrevBlock);
|
||||||
if (mi == mapBlockIndex.end())
|
if (mi == mapBlockIndex.end())
|
||||||
{
|
{
|
||||||
//fprintf(stderr,"AcceptBlockHeader hashPrevBlock %s not found\n",block.hashPrevBlock.ToString().c_str());
|
|
||||||
/*if ( komodo_requestedhash == zero )
|
|
||||||
{
|
|
||||||
komodo_requestedhash = block.hashPrevBlock;
|
|
||||||
komodo_requestedcount = 0;
|
|
||||||
}*/
|
|
||||||
LogPrintf("AcceptBlockHeader hashPrevBlock %s not found\n",block.hashPrevBlock.ToString().c_str());
|
LogPrintf("AcceptBlockHeader hashPrevBlock %s not found\n",block.hashPrevBlock.ToString().c_str());
|
||||||
return(false);
|
return(false);
|
||||||
//return state.DoS(10, error("%s: prev block not found", __func__), 0, "bad-prevblk");
|
//return state.DoS(10, error("%s: prev block not found", __func__), 0, "bad-prevblk");
|
||||||
@@ -4057,12 +4046,6 @@ bool AcceptBlockHeader(int32_t *futureblockp,const CBlockHeader& block, CValidat
|
|||||||
pindexPrev = (*mi).second;
|
pindexPrev = (*mi).second;
|
||||||
if (pindexPrev == 0 )
|
if (pindexPrev == 0 )
|
||||||
{
|
{
|
||||||
/*fprintf(stderr,"AcceptBlockHeader failed no pindexPrev %s\n",block.hashPrevBlock.ToString().c_str());
|
|
||||||
if ( komodo_requestedhash == zero )
|
|
||||||
{
|
|
||||||
komodo_requestedhash = block.hashPrevBlock;
|
|
||||||
komodo_requestedcount = 0;
|
|
||||||
}*/
|
|
||||||
LogPrintf("AcceptBlockHeader hashPrevBlock %s no pindexPrev\n",block.hashPrevBlock.ToString().c_str());
|
LogPrintf("AcceptBlockHeader hashPrevBlock %s no pindexPrev\n",block.hashPrevBlock.ToString().c_str());
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
@@ -4154,7 +4137,6 @@ bool AcceptBlock(int32_t *futureblockp,CBlock& block, CValidationState& state, C
|
|||||||
}
|
}
|
||||||
|
|
||||||
int nHeight = pindex->nHeight;
|
int nHeight = pindex->nHeight;
|
||||||
|
|
||||||
// Write block to history file
|
// Write block to history file
|
||||||
try {
|
try {
|
||||||
unsigned int nBlockSize = ::GetSerializeSize(block, SER_DISK, CLIENT_VERSION);
|
unsigned int nBlockSize = ::GetSerializeSize(block, SER_DISK, CLIENT_VERSION);
|
||||||
@@ -4280,8 +4262,8 @@ bool ProcessNewBlock(bool from_miner,int32_t height,CValidationState &state, CNo
|
|||||||
bool checked; uint256 hash; int32_t futureblock=0;
|
bool checked; uint256 hash; int32_t futureblock=0;
|
||||||
auto verifier = libzcash::ProofVerifier::Disabled();
|
auto verifier = libzcash::ProofVerifier::Disabled();
|
||||||
hash = pblock->GetHash();
|
hash = pblock->GetHash();
|
||||||
//fprintf(stderr,"process newblock %s\n",hash.ToString().c_str());
|
|
||||||
if ( chainActive.Tip() != 0 )
|
if ( chainActive.Tip() != 0 )
|
||||||
komodo_currentheight_set(chainActive.Tip()->nHeight);
|
komodo_currentheight_set(chainActive.Tip()->nHeight);
|
||||||
checked = CheckBlock(&futureblock,height!=0?height:komodo_block2height(pblock),0,*pblock, state, verifier,0);
|
checked = CheckBlock(&futureblock,height!=0?height:komodo_block2height(pblock),0,*pblock, state, verifier,0);
|
||||||
{
|
{
|
||||||
@@ -6164,10 +6146,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
|||||||
return error("non-continuous headers sequence");
|
return error("non-continuous headers sequence");
|
||||||
}
|
}
|
||||||
int32_t futureblock;
|
int32_t futureblock;
|
||||||
//fprintf(stderr,"headers msg nCount.%d\n",(int32_t)nCount);
|
|
||||||
if (!AcceptBlockHeader(&futureblock,header, state, &pindexLast)) {
|
if (!AcceptBlockHeader(&futureblock,header, state, &pindexLast)) {
|
||||||
int nDoS;
|
int nDoS;
|
||||||
if (state.IsInvalid(nDoS))
|
if (state.IsInvalid(nDoS) && futureblock == 0)
|
||||||
{
|
{
|
||||||
if (nDoS > 0 && futureblock == 0)
|
if (nDoS > 0 && futureblock == 0)
|
||||||
Misbehaving(pfrom->GetId(), nDoS/nDoS);
|
Misbehaving(pfrom->GetId(), nDoS/nDoS);
|
||||||
|
|||||||
@@ -1258,8 +1258,8 @@ UniValue gettxout(const UniValue& params, bool fHelp)
|
|||||||
" \"hex\" : \"hex\", (string) \n"
|
" \"hex\" : \"hex\", (string) \n"
|
||||||
" \"reqSigs\" : n, (numeric) Number of required signatures\n"
|
" \"reqSigs\" : n, (numeric) Number of required signatures\n"
|
||||||
" \"type\" : \"pubkeyhash\", (string) The type, eg pubkeyhash\n"
|
" \"type\" : \"pubkeyhash\", (string) The type, eg pubkeyhash\n"
|
||||||
" \"addresses\" : [ (array of string) array of Zcash addresses\n"
|
" \"addresses\" : [ (array of string) array of Komodo addresses\n"
|
||||||
" \"zcashaddress\" (string) Zcash address\n"
|
" \"komodoaddress\" (string) Komodo address\n"
|
||||||
" ,...\n"
|
" ,...\n"
|
||||||
" ]\n"
|
" ]\n"
|
||||||
" },\n"
|
" },\n"
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ UniValue generate(const UniValue& params, bool fHelp)
|
|||||||
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Wallet disabled and -mineraddress not set");
|
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Wallet disabled and -mineraddress not set");
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "zcashd compiled without wallet and -mineraddress not set");
|
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "komodod compiled without wallet and -mineraddress not set");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (!Params().MineBlocksOnDemand())
|
if (!Params().MineBlocksOnDemand())
|
||||||
@@ -304,7 +304,7 @@ UniValue setgenerate(const UniValue& params, bool fHelp)
|
|||||||
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Wallet disabled and -mineraddress not set");
|
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Wallet disabled and -mineraddress not set");
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "zcashd compiled without wallet and -mineraddress not set");
|
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "komodod compiled without wallet and -mineraddress not set");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (Params().MineBlocksOnDemand())
|
if (Params().MineBlocksOnDemand())
|
||||||
@@ -506,7 +506,7 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
|
|||||||
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Wallet disabled and -mineraddress not set");
|
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Wallet disabled and -mineraddress not set");
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "zcashd compiled without wallet and -mineraddress not set");
|
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "komodod compiled without wallet and -mineraddress not set");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -563,7 +563,7 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
|
|||||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode");
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode");
|
||||||
|
|
||||||
if (vNodes.empty())
|
if (vNodes.empty())
|
||||||
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Zcash is not connected!");
|
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Komodo is not connected!");
|
||||||
|
|
||||||
//if (IsInitialBlockDownload())
|
//if (IsInitialBlockDownload())
|
||||||
// throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Zcash is downloading blocks...");
|
// throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Zcash is downloading blocks...");
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ UniValue getinfo(const UniValue& params, bool fHelp)
|
|||||||
" \"version\": xxxxx, (numeric) the server version\n"
|
" \"version\": xxxxx, (numeric) the server version\n"
|
||||||
" \"protocolversion\": xxxxx, (numeric) the protocol version\n"
|
" \"protocolversion\": xxxxx, (numeric) the protocol version\n"
|
||||||
" \"walletversion\": xxxxx, (numeric) the wallet version\n"
|
" \"walletversion\": xxxxx, (numeric) the wallet version\n"
|
||||||
" \"balance\": xxxxxxx, (numeric) the total Zcash balance of the wallet\n"
|
" \"balance\": xxxxxxx, (numeric) the total Komodo balance of the wallet\n"
|
||||||
" \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n"
|
" \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n"
|
||||||
" \"timeoffset\": xxxxx, (numeric) the time offset\n"
|
" \"timeoffset\": xxxxx, (numeric) the time offset\n"
|
||||||
" \"connections\": xxxxx, (numeric) the number of connections\n"
|
" \"connections\": xxxxx, (numeric) the number of connections\n"
|
||||||
@@ -287,14 +287,14 @@ UniValue validateaddress(const UniValue& params, bool fHelp)
|
|||||||
{
|
{
|
||||||
if (fHelp || params.size() != 1)
|
if (fHelp || params.size() != 1)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"validateaddress \"zcashaddress\"\n"
|
"validateaddress \"komodoaddress\"\n"
|
||||||
"\nReturn information about the given Zcash address.\n"
|
"\nReturn information about the given Komodo address.\n"
|
||||||
"\nArguments:\n"
|
"\nArguments:\n"
|
||||||
"1. \"zcashaddress\" (string, required) The Zcash address to validate\n"
|
"1. \"komodoaddress\" (string, required) The Komodo address to validate\n"
|
||||||
"\nResult:\n"
|
"\nResult:\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" \"isvalid\" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned.\n"
|
" \"isvalid\" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned.\n"
|
||||||
" \"address\" : \"zcashaddress\", (string) The Zcash address validated\n"
|
" \"address\" : \"komodoaddress\", (string) The Komodo address validated\n"
|
||||||
" \"scriptPubKey\" : \"hex\", (string) The hex encoded scriptPubKey generated by the address\n"
|
" \"scriptPubKey\" : \"hex\", (string) The hex encoded scriptPubKey generated by the address\n"
|
||||||
" \"ismine\" : true|false, (boolean) If the address is yours or not\n"
|
" \"ismine\" : true|false, (boolean) If the address is yours or not\n"
|
||||||
" \"isscript\" : true|false, (boolean) If the key is a script\n"
|
" \"isscript\" : true|false, (boolean) If the key is a script\n"
|
||||||
@@ -303,8 +303,8 @@ UniValue validateaddress(const UniValue& params, bool fHelp)
|
|||||||
" \"account\" : \"account\" (string) DEPRECATED. The account associated with the address, \"\" is the default account\n"
|
" \"account\" : \"account\" (string) DEPRECATED. The account associated with the address, \"\" is the default account\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\nExamples:\n"
|
"\nExamples:\n"
|
||||||
+ HelpExampleCli("validateaddress", "\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"")
|
+ HelpExampleCli("validateaddress", "\"RTZMZHDFSTFQst8XmX2dR4DaH87cEUs3gC\"")
|
||||||
+ HelpExampleRpc("validateaddress", "\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"")
|
+ HelpExampleRpc("validateaddress", "\"RTZMZHDFSTFQst8XmX2dR4DaH87cEUs3gC\"")
|
||||||
);
|
);
|
||||||
|
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
@@ -478,9 +478,9 @@ UniValue createmultisig(const UniValue& params, bool fHelp)
|
|||||||
|
|
||||||
"\nArguments:\n"
|
"\nArguments:\n"
|
||||||
"1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.\n"
|
"1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.\n"
|
||||||
"2. \"keys\" (string, required) A json array of keys which are Zcash addresses or hex-encoded public keys\n"
|
"2. \"keys\" (string, required) A json array of keys which are Komodo addresses or hex-encoded public keys\n"
|
||||||
" [\n"
|
" [\n"
|
||||||
" \"key\" (string) Zcash address or hex-encoded public key\n"
|
" \"key\" (string) Komodo address or hex-encoded public key\n"
|
||||||
" ,...\n"
|
" ,...\n"
|
||||||
" ]\n"
|
" ]\n"
|
||||||
|
|
||||||
@@ -492,9 +492,9 @@ UniValue createmultisig(const UniValue& params, bool fHelp)
|
|||||||
|
|
||||||
"\nExamples:\n"
|
"\nExamples:\n"
|
||||||
"\nCreate a multisig address from 2 addresses\n"
|
"\nCreate a multisig address from 2 addresses\n"
|
||||||
+ HelpExampleCli("createmultisig", "2 \"[\\\"t16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"t171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"") +
|
+ HelpExampleCli("createmultisig", "2 \"[\\\"RTZMZHDFSTFQst8XmX2dR4DaH87cEUs3gC\\\",\\\"RNKiEBduBru6Siv1cZRVhp4fkZNyPska6z\\\"]\"") +
|
||||||
"\nAs a json rpc call\n"
|
"\nAs a json rpc call\n"
|
||||||
+ HelpExampleRpc("createmultisig", "2, \"[\\\"t16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"t171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"")
|
+ HelpExampleRpc("createmultisig", "2, \"[\\\"RTZMZHDFSTFQst8XmX2dR4DaH87cEUs3gC\\\",\\\"RNKiEBduBru6Siv1cZRVhp4fkZNyPska6z\\\"]\"")
|
||||||
;
|
;
|
||||||
throw runtime_error(msg);
|
throw runtime_error(msg);
|
||||||
}
|
}
|
||||||
@@ -515,10 +515,10 @@ UniValue verifymessage(const UniValue& params, bool fHelp)
|
|||||||
{
|
{
|
||||||
if (fHelp || params.size() != 3)
|
if (fHelp || params.size() != 3)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"verifymessage \"zcashaddress\" \"signature\" \"message\"\n"
|
"verifymessage \"komodoaddress\" \"signature\" \"message\"\n"
|
||||||
"\nVerify a signed message\n"
|
"\nVerify a signed message\n"
|
||||||
"\nArguments:\n"
|
"\nArguments:\n"
|
||||||
"1. \"zcashaddress\" (string, required) The Zcash address to use for the signature.\n"
|
"1. \"komodoaddress\" (string, required) The Komodo address to use for the signature.\n"
|
||||||
"2. \"signature\" (string, required) The signature provided by the signer in base 64 encoding (see signmessage).\n"
|
"2. \"signature\" (string, required) The signature provided by the signer in base 64 encoding (see signmessage).\n"
|
||||||
"3. \"message\" (string, required) The message that was signed.\n"
|
"3. \"message\" (string, required) The message that was signed.\n"
|
||||||
"\nResult:\n"
|
"\nResult:\n"
|
||||||
@@ -527,11 +527,11 @@ UniValue verifymessage(const UniValue& params, bool fHelp)
|
|||||||
"\nUnlock the wallet for 30 seconds\n"
|
"\nUnlock the wallet for 30 seconds\n"
|
||||||
+ HelpExampleCli("walletpassphrase", "\"mypassphrase\" 30") +
|
+ HelpExampleCli("walletpassphrase", "\"mypassphrase\" 30") +
|
||||||
"\nCreate the signature\n"
|
"\nCreate the signature\n"
|
||||||
+ HelpExampleCli("signmessage", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\" \"my message\"") +
|
+ HelpExampleCli("signmessage", "\"RNKiEBduBru6Siv1cZRVhp4fkZNyPska6z\" \"my message\"") +
|
||||||
"\nVerify the signature\n"
|
"\nVerify the signature\n"
|
||||||
+ HelpExampleCli("verifymessage", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\" \"signature\" \"my message\"") +
|
+ HelpExampleCli("verifymessage", "\"RNKiEBduBru6Siv1cZRVhp4fkZNyPska6z\" \"signature\" \"my message\"") +
|
||||||
"\nAs json rpc\n"
|
"\nAs json rpc\n"
|
||||||
+ HelpExampleRpc("verifymessage", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\", \"signature\", \"my message\"")
|
+ HelpExampleRpc("verifymessage", "\"RNKiEBduBru6Siv1cZRVhp4fkZNyPska6z\", \"signature\", \"my message\"")
|
||||||
);
|
);
|
||||||
|
|
||||||
LOCK(cs_main);
|
LOCK(cs_main);
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ UniValue getaddednodeinfo(const UniValue& params, bool fHelp)
|
|||||||
" \"connected\" : true|false, (boolean) If connected\n"
|
" \"connected\" : true|false, (boolean) If connected\n"
|
||||||
" \"addresses\" : [\n"
|
" \"addresses\" : [\n"
|
||||||
" {\n"
|
" {\n"
|
||||||
" \"address\" : \"192.168.0.201:8233\", (string) The Zcash server host and port\n"
|
" \"address\" : \"192.168.0.201:8233\", (string) The Komodo server host and port\n"
|
||||||
" \"connected\" : \"outbound\" (string) connection, inbound or outbound\n"
|
" \"connected\" : \"outbound\" (string) connection, inbound or outbound\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
" ,...\n"
|
" ,...\n"
|
||||||
|
|||||||
@@ -326,7 +326,7 @@ UniValue getrawtransaction(const UniValue& params, bool fHelp)
|
|||||||
" \"reqSigs\" : n, (numeric) The required sigs\n"
|
" \"reqSigs\" : n, (numeric) The required sigs\n"
|
||||||
" \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n"
|
" \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n"
|
||||||
" \"addresses\" : [ (json array of string)\n"
|
" \"addresses\" : [ (json array of string)\n"
|
||||||
" \"zcashaddress\" (string) Zcash address\n"
|
" \"komodoaddress\" (string) Komodo address\n"
|
||||||
" ,...\n"
|
" ,...\n"
|
||||||
" ]\n"
|
" ]\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
@@ -601,7 +601,7 @@ UniValue createrawtransaction(const UniValue& params, bool fHelp)
|
|||||||
" ]\n"
|
" ]\n"
|
||||||
"2. \"addresses\" (string, required) a json object with addresses as keys and amounts as values\n"
|
"2. \"addresses\" (string, required) a json object with addresses as keys and amounts as values\n"
|
||||||
" {\n"
|
" {\n"
|
||||||
" \"address\": x.xxx (numeric, required) The key is the Zcash address, the value is the " + CURRENCY_UNIT + " amount\n"
|
" \"address\": x.xxx (numeric, required) The key is the Komodo address, the value is the " + CURRENCY_UNIT + " amount\n"
|
||||||
" ,...\n"
|
" ,...\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
|
|
||||||
@@ -652,7 +652,7 @@ UniValue createrawtransaction(const UniValue& params, bool fHelp)
|
|||||||
BOOST_FOREACH(const string& name_, addrList) {
|
BOOST_FOREACH(const string& name_, addrList) {
|
||||||
CBitcoinAddress address(name_);
|
CBitcoinAddress address(name_);
|
||||||
if (!address.IsValid())
|
if (!address.IsValid())
|
||||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid Zcash address: ")+name_);
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid Komodo address: ")+name_);
|
||||||
|
|
||||||
if (setAddress.count(address))
|
if (setAddress.count(address))
|
||||||
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+name_);
|
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+name_);
|
||||||
@@ -708,7 +708,7 @@ UniValue decoderawtransaction(const UniValue& params, bool fHelp)
|
|||||||
" \"reqSigs\" : n, (numeric) The required sigs\n"
|
" \"reqSigs\" : n, (numeric) The required sigs\n"
|
||||||
" \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n"
|
" \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n"
|
||||||
" \"addresses\" : [ (json array of string)\n"
|
" \"addresses\" : [ (json array of string)\n"
|
||||||
" \"t12tvKAXCxZjSmdNbao16dKXC8tRWfcF5oc\" (string) zcash address\n"
|
" \"RTZMZHDFSTFQst8XmX2dR4DaH87cEUs3gC\" (string) komodo address\n"
|
||||||
" ,...\n"
|
" ,...\n"
|
||||||
" ]\n"
|
" ]\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
@@ -778,7 +778,7 @@ UniValue decodescript(const UniValue& params, bool fHelp)
|
|||||||
" \"type\":\"type\", (string) The output type\n"
|
" \"type\":\"type\", (string) The output type\n"
|
||||||
" \"reqSigs\": n, (numeric) The required signatures\n"
|
" \"reqSigs\": n, (numeric) The required signatures\n"
|
||||||
" \"addresses\": [ (json array of string)\n"
|
" \"addresses\": [ (json array of string)\n"
|
||||||
" \"address\" (string) Zcash address\n"
|
" \"address\" (string) Komodo address\n"
|
||||||
" ,...\n"
|
" ,...\n"
|
||||||
" ],\n"
|
" ],\n"
|
||||||
" \"p2sh\",\"address\" (string) script address\n"
|
" \"p2sh\",\"address\" (string) script address\n"
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
|
|||||||
|
|
||||||
CValidationState state;
|
CValidationState state;
|
||||||
|
|
||||||
if (ProcessNewBlock(1,state, NULL, pblock, true, NULL) && state.IsValid()) {
|
if (ProcessNewBlock(1,0,state, NULL, pblock, true, NULL) && state.IsValid()) {
|
||||||
goto foundit;
|
goto foundit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,7 +261,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
CValidationState state;
|
CValidationState state;
|
||||||
BOOST_CHECK(ProcessNewBlock(1,state, NULL, pblock, true, NULL));
|
BOOST_CHECK(ProcessNewBlock(1,0,state, NULL, pblock, true, NULL));
|
||||||
BOOST_CHECK_MESSAGE(state.IsValid(), state.GetRejectReason());
|
BOOST_CHECK_MESSAGE(state.IsValid(), state.GetRejectReason());
|
||||||
pblock->hashPrevBlock = pblock->GetHash();
|
pblock->hashPrevBlock = pblock->GetHash();
|
||||||
|
|
||||||
|
|||||||
@@ -80,10 +80,10 @@ UniValue importprivkey(const UniValue& params, bool fHelp)
|
|||||||
|
|
||||||
if (fHelp || params.size() < 1 || params.size() > 3)
|
if (fHelp || params.size() < 1 || params.size() > 3)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"importprivkey \"zcashprivkey\" ( \"label\" rescan )\n"
|
"importprivkey \"komodoprivkey\" ( \"label\" rescan )\n"
|
||||||
"\nAdds a private key (as returned by dumpprivkey) to your wallet.\n"
|
"\nAdds a private key (as returned by dumpprivkey) to your wallet.\n"
|
||||||
"\nArguments:\n"
|
"\nArguments:\n"
|
||||||
"1. \"zcashprivkey\" (string, required) The private key (see dumpprivkey)\n"
|
"1. \"komodoprivkey\" (string, required) The private key (see dumpprivkey)\n"
|
||||||
"2. \"label\" (string, optional, default=\"\") An optional label\n"
|
"2. \"label\" (string, optional, default=\"\") An optional label\n"
|
||||||
"3. rescan (boolean, optional, default=true) Rescan the wallet for transactions\n"
|
"3. rescan (boolean, optional, default=true) Rescan the wallet for transactions\n"
|
||||||
"\nNote: This call can take minutes to complete if rescan is true.\n"
|
"\nNote: This call can take minutes to complete if rescan is true.\n"
|
||||||
@@ -388,11 +388,11 @@ UniValue dumpprivkey(const UniValue& params, bool fHelp)
|
|||||||
|
|
||||||
if (fHelp || params.size() != 1)
|
if (fHelp || params.size() != 1)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"dumpprivkey \"zcashaddress\"\n"
|
"dumpprivkey \"komodoaddress\"\n"
|
||||||
"\nReveals the private key corresponding to 'zcashaddress'.\n"
|
"\nReveals the private key corresponding to 'komodoaddress'.\n"
|
||||||
"Then the importprivkey can be used with this output\n"
|
"Then the importprivkey can be used with this output\n"
|
||||||
"\nArguments:\n"
|
"\nArguments:\n"
|
||||||
"1. \"zcashaddress\" (string, required) The zcash address for the private key\n"
|
"1. \"komodoaddress\" (string, required) The komodo address for the private key\n"
|
||||||
"\nResult:\n"
|
"\nResult:\n"
|
||||||
"\"key\" (string) The private key\n"
|
"\"key\" (string) The private key\n"
|
||||||
"\nExamples:\n"
|
"\nExamples:\n"
|
||||||
@@ -430,7 +430,7 @@ UniValue z_exportwallet(const UniValue& params, bool fHelp)
|
|||||||
"z_exportwallet \"filename\"\n"
|
"z_exportwallet \"filename\"\n"
|
||||||
"\nExports all wallet keys, for taddr and zaddr, in a human-readable format. Overwriting an existing file is not permitted.\n"
|
"\nExports all wallet keys, for taddr and zaddr, in a human-readable format. Overwriting an existing file is not permitted.\n"
|
||||||
"\nArguments:\n"
|
"\nArguments:\n"
|
||||||
"1. \"filename\" (string, required) The filename, saved in folder set by zcashd -exportdir option\n"
|
"1. \"filename\" (string, required) The filename, saved in folder set by komodod -exportdir option\n"
|
||||||
"\nResult:\n"
|
"\nResult:\n"
|
||||||
"\"path\" (string) The full path of the destination file\n"
|
"\"path\" (string) The full path of the destination file\n"
|
||||||
"\nExamples:\n"
|
"\nExamples:\n"
|
||||||
@@ -451,7 +451,7 @@ UniValue dumpwallet(const UniValue& params, bool fHelp)
|
|||||||
"dumpwallet \"filename\"\n"
|
"dumpwallet \"filename\"\n"
|
||||||
"\nDumps taddr wallet keys in a human-readable format. Overwriting an existing file is not permitted.\n"
|
"\nDumps taddr wallet keys in a human-readable format. Overwriting an existing file is not permitted.\n"
|
||||||
"\nArguments:\n"
|
"\nArguments:\n"
|
||||||
"1. \"filename\" (string, required) The filename, saved in folder set by zcashd -exportdir option\n"
|
"1. \"filename\" (string, required) The filename, saved in folder set by komodod -exportdir option\n"
|
||||||
"\nResult:\n"
|
"\nResult:\n"
|
||||||
"\"path\" (string) The full path of the destination file\n"
|
"\"path\" (string) The full path of the destination file\n"
|
||||||
"\nExamples:\n"
|
"\nExamples:\n"
|
||||||
@@ -475,7 +475,7 @@ UniValue dumpwallet_impl(const UniValue& params, bool fHelp, bool fDumpZKeys)
|
|||||||
throw JSONRPCError(RPC_INTERNAL_ERROR, e.what());
|
throw JSONRPCError(RPC_INTERNAL_ERROR, e.what());
|
||||||
}
|
}
|
||||||
if (exportdir.empty()) {
|
if (exportdir.empty()) {
|
||||||
throw JSONRPCError(RPC_WALLET_ERROR, "Cannot export wallet until the zcashd -exportdir option has been set");
|
throw JSONRPCError(RPC_WALLET_ERROR, "Cannot export wallet until the komodod -exportdir option has been set");
|
||||||
}
|
}
|
||||||
std::string unclean = params[0].get_str();
|
std::string unclean = params[0].get_str();
|
||||||
std::string clean = SanitizeFilename(unclean);
|
std::string clean = SanitizeFilename(unclean);
|
||||||
|
|||||||
Reference in New Issue
Block a user