 |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
Go to the documentation of this file.
27 #include <boost/assign/list_of.hpp>
51 lookup = pb->
nHeight % 2016 + 1;
59 int64_t maxTime = minTime;
60 for (
int i = 0; i < lookup; i++) {
63 minTime = std::min(time, minTime);
64 maxTime = std::max(time, maxTime);
68 if (minTime == maxTime)
72 int64_t timeDiff = maxTime - minTime;
74 return (int64_t)(workDiff.
getdouble() / timeDiff);
79 if (fHelp || params.
size() > 2)
80 throw std::runtime_error(
81 "getnetworkhashps ( blocks height )\n"
82 "\nReturns the estimated network hashes per second based on the last n blocks.\n"
83 "Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change.\n"
84 "Pass in [height] to estimate the network speed at the time when a certain block was found.\n"
86 "1. blocks (numeric, optional, default=120) The number of blocks, or -1 for blocks since last difficulty change.\n"
87 "2. height (numeric, optional, default=-1) To estimate at the time of the given height.\n"
89 "x (numeric) Hashes per second estimated\n"
100 if (fHelp || params.
size() != 0)
101 throw std::runtime_error(
103 "\nReturn if the server is set to generate coins or not. The default is false.\n"
104 "It is set with the command line argument -gen (or prcycoin.conf setting gen)\n"
105 "It can also be set with the setgenerate call.\n"
107 "true|false (boolean) If the server is set to generate coins or not\n"
117 if (fHelp || params.
size() < 1 || params.
size() > 1)
118 throw std::runtime_error(
119 "generate numblocks\n"
120 "\nMine blocks immediately (before the RPC call returns)\n"
121 "\nNote: this function can only be used on the regtest network\n"
124 "1. numblocks (numeric, required) How many blocks to generate.\n"
127 "[ blockhashes ] (array) hashes of blocks generated\n"
130 "\nGenerate 11 blocks\n"
134 if (!
Params().MineBlocksOnDemand())
137 int nHeightStart = 0;
140 int nGenerate = params[0].
get_int();
146 nHeight = nHeightStart;
147 nHeightEnd = nHeightStart+nGenerate;
149 unsigned int nExtraNonce = 0;
152 while (nHeight < nHeightEnd)
154 std::unique_ptr<CBlockTemplate> pblocktemplate(CreateNewBlockWithKey(reservekey,
pwalletMain, fPoS));
155 if (!pblocktemplate.get())
157 CBlock *pblock = &pblocktemplate->block;
181 if (fHelp || params.
size() < 1 || params.
size() > 2)
182 throw std::runtime_error(
183 "setgenerate generate ( genproclimit )\n"
184 "\nSet 'generate' true or false to turn generation on or off.\n"
185 "Generation is limited to 'genproclimit' processors, -1 is unlimited.\n"
186 "See the getgenerate call for the current setting.\n"
188 "1. generate (boolean, required) Set to true to turn on generation, false to turn off.\n"
189 "2. genproclimit (numeric, optional) Set the processor limit for when generation is on. Can be -1 for unlimited.\n"
192 "\nSet the generation on with a limit of one processor\n" +
195 "\nTurn off generation\n" +
HelpExampleCli(
"setgenerate",
"false") +
201 if (
Params().MineBlocksOnDemand())
204 bool fGenerate =
true;
205 if (params.
size() > 0)
208 int nGenProcLimit = -1;
209 if (params.
size() > 1) {
210 nGenProcLimit = params[1].
get_int();
211 if (nGenProcLimit == 0)
215 mapArgs[
"-gen"] = (fGenerate ?
"1" :
"0");
218 GeneratePrcycoins(fGenerate,
pwalletMain, nGenProcLimit);
226 if (fHelp || params.
size() != 1)
227 throw std::runtime_error(
228 "generatepoa generate PoA blocks ( genproclimit )\n"
230 "1. period (numeric, optional) Set the interval for creating a poa block \n"
231 " Note: in -regtest mode, period is not needed, one poa block can be generated on demand.\n"
233 "blockhash (-regtest only) hash of generated poa block\n"
235 "\nSet generate a poa block every 30 minutes\n" +
249 if (params.
size() > 1) {
254 int nHeightStart = 0;
263 nHeight = nHeightStart;
264 nHeightEnd = nHeightStart + nGenerate;
267 unsigned int nExtraNonce = 0;
271 bool createPoABlock =
false;
272 if (nHeight >=
Params().LAST_POW_BLOCK()) {
273 createPoABlock =
true;
276 if (!createPoABlock) {
280 std::unique_ptr<CBlockTemplate> pblocktemplate(CreateNewPoABlockWithKey(reservekey,
pwalletMain));
281 if (!pblocktemplate.get())
283 CBlock* pblock = &pblocktemplate->block;
295 if (fHelp || params.
size() != 0)
296 throw std::runtime_error(
298 "\nReturns a recent hashes per second performance measurement while generating.\n"
299 "See the getgenerate and setgenerate calls to turn generation on and off.\n"
301 "n (numeric) The recent hashes per second when generation is on (will return 0 if generation is off)\n"
314 if (fHelp || params.
size() != 0)
315 throw std::runtime_error(
317 "\nReturns a json object containing mining-related information."
320 " \"blocks\": nnn, (numeric) The current block\n"
321 " \"currentblocksize\": nnn, (numeric) The last block size\n"
322 " \"currentblocktx\": nnn, (numeric) The last block transaction\n"
323 " \"difficulty\": xxx.xxxxx (numeric) The current difficulty\n"
324 " \"errors\": \"...\" (string) Current errors\n"
325 " \"generate\": true|false (boolean) If the generation is on or off (see getgenerate or setgenerate calls)\n"
326 " \"genproclimit\": n (numeric) The processor limit for generation. -1 if no generation. (see getgenerate or setgenerate calls)\n"
327 " \"hashespersec\": n (numeric) The hashes per second of the generation, or 0 if no generation.\n"
328 " \"pooledtx\": n (numeric) The size of the mem pool\n"
329 " \"testnet\": true|false (boolean) If using testnet or not\n"
330 " \"chain\": \"xxxx\", (string) current network name (main, test, regtest)\n"
346 obj.
push_back(Pair(
"testnet",
Params().TestnetToBeDeprecatedFieldRPC()));
359 if (fHelp || params.
size() != 3)
360 throw std::runtime_error(
361 "prioritisetransaction <txid> <priority delta> <fee delta>\n"
362 "Accepts the transaction into mined blocks at a higher (or lower) priority\n"
364 "1. \"txid\" (string, required) The transaction id.\n"
365 "2. priority delta (numeric, required) The priority to add or subtract.\n"
366 " The transaction selection algorithm considers the tx as it would have a higher priority.\n"
367 " (priority of a transaction is calculated: coinage * value_in_duffs / txsize) \n"
368 "3. fee delta (numeric, required) The fee value (in duffs) to add (or subtract, if negative).\n"
369 " The fee is not actually paid, only the algorithm for selecting transactions into a block\n"
370 " considers the transaction as it would have paid a higher (or lower) fee.\n"
372 "true (boolean) Returns true\n"
397 if (strRejectReason.empty())
399 return strRejectReason;
407 if (fHelp || params.
size() > 1)
408 throw std::runtime_error(
409 "getblocktemplate ( \"jsonrequestobject\" )\n"
410 "\nIf the request parameters include a 'mode' key, that is used to explicitly select between the default 'template' request or a 'proposal'.\n"
411 "It returns data needed to construct a block to work on.\n"
412 "See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\n"
415 "1. \"jsonrequestobject\" (string, optional) A json object in the following spec\n"
417 " \"mode\":\"template\" (string, optional) This must be set to \"template\" or omitted\n"
418 " \"capabilities\":[ (array, optional) A list of strings\n"
419 " \"support\" (string) client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid'\n"
427 " \"version\" : n, (numeric) The block version\n"
428 " \"previousblockhash\" : \"xxxx\", (string) The hash of current highest block\n"
429 " \"transactions\" : [ (array) contents of non-coinbase transactions that should be included in the next block\n"
431 " \"data\" : \"xxxx\", (string) transaction data encoded in hexadecimal (byte-for-byte)\n"
432 " \"hash\" : \"xxxx\", (string) hash/id encoded in little-endian hexadecimal\n"
433 " \"depends\" : [ (array) array of numbers \n"
434 " n (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is\n"
437 " \"fee\": n, (numeric) difference in value between transaction inputs and outputs (in duffs); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one\n"
438 " \"sigops\" : n, (numeric) total number of SigOps, as counted for purposes of block limits; if key is not present, sigop count is unknown and clients MUST NOT assume there aren't any\n"
439 " \"required\" : true|false (boolean) if provided and true, this transaction must be in the final block\n"
443 " \"coinbaseaux\" : { (json object) data that should be included in the coinbase's scriptSig content\n"
444 " \"flags\" : \"flags\" (string) \n"
446 " \"coinbasevalue\" : n, (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in duffs)\n"
447 " \"coinbasetxn\" : { ... }, (json object) information for coinbase transaction\n"
448 " \"target\" : \"xxxx\", (string) The hash target\n"
449 " \"mintime\" : xxx, (numeric) The minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT)\n"
450 " \"mutable\" : [ (array of string) list of ways the block template may be changed \n"
451 " \"value\" (string) A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'\n"
454 " \"noncerange\" : \"00000000ffffffff\", (string) A range of valid nonces\n"
455 " \"sigoplimit\" : n, (numeric) limit of sigops in blocks\n"
456 " \"sizelimit\" : n, (numeric) limit of block size\n"
457 " \"curtime\" : ttt, (numeric) current timestamp in seconds since epoch (Jan 1 1970 GMT)\n"
458 " \"bits\" : \"xxx\", (string) compressed target of next block\n"
459 " \"height\" : n (numeric) The height of the next block\n"
460 " \"payee\" : \"xxx\", (string) required payee for the next block\n"
461 " \"payee_amount\" : n, (numeric) required amount to pay\n"
462 " \"votes\" : [\n (array) show vote candidates\n"
463 " { ... } (json object) vote candidate\n"
466 " \"masternode_payments\" : true|false, (boolean) true, if masternode payments are enabled\n"
467 " \"enforce_masternode_payments\" : true|false (boolean) true, if masternode payments are enforced\n"
475 std::string strMode =
"template";
477 if (params.
size() > 0) {
482 else if (modeval.
isNull()) {
488 if (strMode ==
"proposal") {
490 if (!dataval.
isStr())
504 return "duplicate-invalid";
505 return "duplicate-inconclusive";
511 return "inconclusive-not-best-prevblk";
514 return BIP22ValidationResult(state);
518 if (strMode !=
"template")
527 static unsigned int nTransactionsUpdatedLast;
533 std::chrono::steady_clock::time_point checktxtime;
534 unsigned int nTransactionsUpdatedLastLP;
538 std::string lpstr = lpval.
get_str();
540 hashWatchedChain.
SetHex(lpstr.substr(0, 64));
541 nTransactionsUpdatedLastLP =
atoi64(lpstr.substr(64));
545 nTransactionsUpdatedLastLP = nTransactionsUpdatedLast;
551 checktxtime = std::chrono::steady_clock::now() + std::chrono::minutes(1);
555 if (
g_best_block_cv.wait_until(lock, checktxtime) == std::cv_status::timeout)
560 checktxtime += std::chrono::seconds(10);
573 static int64_t nStart;
586 if (pblocktemplate) {
587 delete pblocktemplate;
588 pblocktemplate = NULL;
593 throw std::runtime_error(
"Wallet is locked, please unlock it");
601 pindexPrev = pindexPrevNew;
612 std::map<uint256, int64_t> setTxIndex;
616 setTxIndex[txHash] = i++;
634 int index_in_template = i - 1;
647 if (aMutable.
empty()) {
656 result.
push_back(Pair(
"capabilities", aCaps));
659 result.
push_back(Pair(
"transactions", transactions));
660 result.
push_back(Pair(
"coinbaseaux", aux));
661 result.
push_back(Pair(
"coinbasevalue", (int64_t)pblock->
vtx[0].GetValueOut()));
665 result.
push_back(Pair(
"mutable", aMutable));
666 result.
push_back(Pair(
"noncerange",
"00000000ffffffff"));
678 result.
push_back(Pair(
"payee_amount", (int64_t)pblock->
vtx[0].vout[1].nValue));
681 result.
push_back(Pair(
"payee_amount",
""));
684 result.
push_back(Pair(
"masternode_payments", pblock->
nTime >
Params().StartMasternodePayments()));
685 result.
push_back(Pair(
"enforce_masternode_payments",
true));
692 if (fHelp || params.
size() > 0)
693 throw std::runtime_error(
694 "getpoablocktemplate\n"
695 "It returns data needed to construct a block to work on.\n"
701 " \"version\" : n, (numeric) The block version\n"
702 " \"previouspoablockhash\" : \"xxxx\", (string) The hash of current highest block\n"
703 " \"poamerkleroot\" : \"xxxx\", (string) The PoA merkle root\n"
704 " \"poahashintegrated\" : \"xxxx\", (string) hash of previouspoablockhash and poamerkleroot\n"
705 " \"coinbasevalue\" : n, (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in duffs)\n"
706 " \"coinbasetxn\" : { ... }, (json object) information for coinbase transaction\n"
707 " \"noncerange\" : \"00000000ffffffff\", (string) A range of valid nonces\n"
708 " \"sigoplimit\" : n, (numeric) limit of sigops in blocks\n"
709 " \"sizelimit\" : n, (numeric) limit of block size\n"
710 " \"curtime\" : ttt, (numeric) current timestamp in seconds since epoch (Jan 1 1970 GMT)\n"
711 " \"bits\" : \"xxx\", (string) compressed target of next block\n"
712 " \"payee\" : \"xxx\", (string) required payee for the next block\n"
713 " \"payee_amount\" : n, (numeric) required amount to pay\n"
714 " \"posblocksaudited\" : [ (array) summaries of PoS blocks that should be included in the next PoA block\n"
716 " \"hash\" : \"xxxx\", (string) block hash\n"
717 " \"height\" : xxxx, (numeric) block height\n"
718 " \"time\": xxxx, (numeric) timestamp \n"
722 " \"masternode_payments\" : true|false, (boolean) true, if masternode payments are enabled\n"
723 " \"enforce_masternode_payments\" : true|false (boolean) true, if masternode payments are enforced\n"
735 std::string strMode =
"template";
738 if (strMode !=
"template")
749 static int64_t nStart;
760 if (pblocktemplate) {
761 delete pblocktemplate;
762 pblocktemplate = NULL;
765 pblocktemplate = CreateNewPoABlockWithKey(reservekey,
pwalletMain);
770 pindexPrev = pindexPrevNew;
782 std::map<uint256, int64_t> setTxIndex;
786 setTxIndex[txHash] = i++;
804 int index_in_template = i - 1;
820 if (aMutable.
empty()) {
844 result.
push_back(Pair(
"transactions", transactions));
845 result.
push_back(Pair(
"coinbasetxn", coinbasetxn));
846 result.
push_back(Pair(
"coinbasevalue", (int64_t)pblock->
vtx[0].GetValueOut()));
847 result.
push_back(Pair(
"noncerange",
"00000000ffffffff"));
852 result.
push_back(Pair(
"posblocksaudited", posBlocksAudited));
859 result.
push_back(Pair(
"payee_amount", (int64_t)pblock->
vtx[0].vout[1].nValue));
862 result.
push_back(Pair(
"payee_amount",
""));
865 result.
push_back(Pair(
"masternode_payments", pblock->
nTime >
Params().StartMasternodePayments()));
866 result.
push_back(Pair(
"enforce_masternode_payments",
true));
872 if (fHelp || params.
size() != 2)
873 throw std::runtime_error(
874 "setminingnbits value 1/0\n");
875 unsigned int nbits = (
unsigned int) params[0].get_int64();
876 int changed= params[1].
get_int();
908 if (fHelp || params.
size() < 1 || params.
size() > 2)
909 throw std::runtime_error(
910 "submitblock \"hexdata\" ( \"jsonparametersobject\" )\n"
911 "\nAttempts to submit new block to network.\n"
912 "The 'jsonparametersobject' parameter is currently ignored.\n"
913 "See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\n"
916 "1. \"hexdata\" (string, required) the hex-encoded block data to submit\n"
917 "2. \"jsonparametersobject\" (string, optional) object of optional parameters\n"
919 " \"workid\" : \"id\" (string, optional) if the server provided a workid, it MUST be included with submissions\n"
927 std::string datastr(params[0].get_str());
929 for (
size_t i = 0; i < datastr.size(); i++) {
930 if ((
'0' <= datastr[i] && datastr[i] <=
'9') || (
'a' <= datastr[i] && datastr[i] <=
'f') || (
'A' <= datastr[i] && datastr[i] <=
'F')) {
942 if (block.
vtx.empty() || !block.
vtx[0].IsCoinBase()) {
949 bool fBlockPresent =
false;
958 return "duplicate-invalid";
960 fBlockPresent =
true;
970 if (fAccepted && !sc.
found)
971 return "duplicate-inconclusive";
976 return "inconclusive";
979 return BIP22ValidationResult(state);
984 if (fHelp || params.
size() != 1)
985 throw std::runtime_error(
986 "estimatefee nblocks\n"
987 "\nEstimates the approximate fee per kilobyte\n"
988 "needed for a transaction to begin confirmation\n"
989 "within nblocks blocks.\n"
991 "1. nblocks (numeric)\n"
993 "n : (numeric) estimated fee-per-kilobyte\n"
995 "-1.0 is returned if not enough transactions and\n"
996 "blocks have been observed to make an estimate.\n"
1002 int nBlocks = params[0].
get_int();
1015 if (fHelp || params.
size() != 1)
1016 throw std::runtime_error(
1017 "estimatepriority nblocks\n"
1018 "\nEstimates the approximate priority\n"
1019 "a zero-fee transaction needs to begin confirmation\n"
1020 "within nblocks blocks.\n"
1022 "1. nblocks (numeric)\n"
1024 "n : (numeric) estimated priority\n"
1026 "-1.0 is returned if not enough transactions and\n"
1027 "blocks have been observed to make an estimate.\n"
1033 int nBlocks = params[0].
get_int();
@ RPC_INVALID_REQUEST
Standard JSON-RPC 2.0 errors.
int64_t GetBlockTime() const
An input of a transaction.
virtual void BlockChecked(const CBlock &block, const CValidationState &stateIn)
std::vector< CNode * > vNodes
bool GenerateAddress(CPubKey &pub, CPubKey &txPub, CKey &txPriv) const
int64_t GetTime()
For unit testing.
UniValue getblocktemplate(const UniValue ¶ms, bool fHelp)
UniValue getpoablocktemplate(const UniValue ¶ms, bool fHelp)
std::string GetHex() const
uint256 ComputePoAMerkleTree(bool *mutated=NULL) const
UniValue ValueFromAmount(const CAmount &amount)
@ RPC_VERIFY_ERROR
Error parsing or validating structure in raw format.
CChain chainActive
The currently-connected chain of blocks.
@ BLOCK_FAILED_MASK
descends from failed block
const UniValue NullUniValue
base58-encoded PRCY addresses.
@ RPC_INVALID_PARAMETER
Ran out of memory during operation.
std::map< std::string, std::string > mapArgs
CBlockIndex * pprev
pointer to the index of the predecessor of this block
int nHeight
height of the entry in the chain. The genesis block has height 0
A key allocated from the key pool.
uint256 ParseHashStr(const std::string &, const std::string &strName)
uint256 & SetCompact(uint32_t nCompact, bool *pfNegative=nullptr, bool *pfOverflow=nullptr)
The "compact" format is a representation of a whole number N using an unsigned 32bit number similar t...
void RegisterValidationInterface(CValidationInterface *pwalletIn)
Register a wallet to receive updates from core.
@ RPC_CLIENT_IN_INITIAL_DOWNLOAD
PRCY is not connected.
uint256 nChainWork
(memory only) Total amount of work (expected number of hashes) in the chain up to and including this ...
void UpdateTime(CBlockHeader *pblock, const CBlockIndex *pindexPrev)
Check mined block.
UniValue getmininginfo(const UniValue ¶ms, bool fHelp)
unsigned int nStatus
Verification status of this block. See enum BlockStatus.
void RPCTypeCheck(const UniValue ¶ms, const std::list< UniValue::VType > &typesExpected, bool fAllowNull)
Type-check arguments; throws JSONRPCError if wrong type given.
std::string GetRejectReason() const
unsigned int GetTransactionsUpdated() const
std::string ToString() const
UniValue prioritisetransaction(const UniValue ¶ms, bool fHelp)
UniValue getnetworkhashps(const UniValue ¶ms, bool fHelp)
Fee rate in PRCY per kilobyte: CAmount / kB.
The basic transaction that is broadcasted on the network and contained in blocks.
const std::string & get_str() const
RecursiveMutex cs_main
Global state.
@ RPC_DESERIALIZATION_ERROR
Database error.
#define ENTER_CRITICAL_SECTION(cs)
int64_t get_int64() const
bool IsInitialBlockDownload()
Check whether we are doing an initial block download (synchronizing from disk or network)
const UniValue & get_obj() const
UniValue estimatepriority(const UniValue ¶ms, bool fHelp)
std::string GetWarnings(std::string strFor)
Format a string that describes several potential problems detected by the core.
int64_t GetMedianTimePast() const
void PrioritiseTransaction(const uint256 hash, const std::string strHash, double dPriorityDelta, const CAmount &nFeeDelta)
Affect CreateNewBlock prioritisation of transactions.
std::condition_variable g_best_block_cv
bool IsValid(enum BlockStatus nUpTo=BLOCK_VALID_TRANSACTIONS) const
Check whether this block index entry is valid up to the passed validity level.
int LAST_POW_BLOCK() const
std::string HexStr(const T itbegin, const T itend, bool fSpaces=false)
bool GetBoolArg(const std::string &strArg, bool fDefault)
Return boolean argument or default value.
UniValue JSONRPCError(int code, const std::string &message)
int64_t CAmount
Amount in PRCY (Can be negative)
CTxMemPool mempool(::minRelayTxFee)
CScript COINBASE_FLAGS
Constant stuff for coinbase transactions we create:
std::string HelpExampleRpc(std::string methodname, std::string args)
UniValue generatepoa(const UniValue ¶ms, bool fHelp)
256-bit unsigned big integer.
void SetHex(const char *psz)
Serialized script, used inside transaction inputs and outputs.
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
bool CheckProofOfWork(uint256 hash, unsigned int nBits)
Check whether a block hash satisfies the proof-of-work requirement specified by nBits.
@ BLOCK_VALID_SCRIPTS
Scripts & signatures ok. Implies all parents are also at least SCRIPTS.
uint256 GetBlockHash() const
std::string EncodeHexPoSBlockSummary(const PoSBlockSummary &pos)
UniValue setminingnbits(const UniValue ¶ms, bool fHelp)
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
int Height() const
Return the maximal height in the chain.
std::vector< int64_t > vTxSigOps
UniValue getgenerate(const UniValue ¶ms, bool fHelp)
std::string HelpExampleCli(std::string methodname, std::string args)
std::vector< CTransaction > vtx
int64_t atoi64(const char *psz)
CBlockTemplate * CreateNewBlock(const CScript &scriptPubKeyIn, const CPubKey &txPub, const CKey &txPriv, CWallet *pwallet, bool fProofOfStake)
Generate a new block, without valid proof-of-work.
@ RPC_OUT_OF_MEMORY
Invalid address or key.
An encapsulated public key.
std::vector< CAmount > vTxFees
An encapsulated private key.
std::string itostr(int n)
void EnsureWalletIsUnlocked(bool fAllowAnonOnly=false)
bool ProcessNewBlock(CValidationState &state, CNode *pfrom, CBlock *pblock, CDiskBlockPos *dbp)
Process an incoming block.
UniValue gethashespersec(const UniValue ¶ms, bool fHelp)
CFeeRate estimateFee(int nBlocks) const
Estimate fee rate needed to get into the next nBlocks.
bool push_back(const UniValue &val)
bool TestBlockValidity(CValidationState &state, const CBlock &block, CBlockIndex *const pindexPrev, bool fCheckPOW, bool fCheckMerkleRoot)
Check a block is completely valid from start to finish (only works on top of our current best block,...
std::string i64tostr(int64_t n)
const CChainParams & Params()
Return the currently selected parameters.
submitblock_StateCatcher(const uint256 &hashIn)
const uint256 & GetHash() const
std::string EncodeHexTx(const CTransaction &tx)
#define LEAVE_CRITICAL_SECTION(cs)
UniValue GetNetworkHashPS(int lookup, int height)
Return average network hashes per second based on the last 'lookup' blocks, or from the last difficul...
bool DecodeHexBlk(CBlock &, const std::string &strHexBlk)
const UniValue & find_value(const UniValue &obj, const std::string &name)
CBlockIndex * Tip(bool fProofOfStake=false) const
Returns the index entry for the tip of this chain, or NULL if none.
@ RPC_TYPE_ERROR
Server is in safe mode, and command is not allowed in safe mode.
void UnregisterValidationInterface(CValidationInterface *pwalletIn)
Unregister a wallet from core.
bool WriteStakingStatus(bool status)
The block chain is a tree shaped structure starting with the genesis block at the root,...
CAmount GetFeePerK() const
UniValue generate(const UniValue ¶ms, bool fHelp)
std::string GetArg(const std::string &strArg, const std::string &strDefault)
Return string argument or default value.
void IncrementExtraNonce(CBlock *pblock, CBlockIndex *pindexPrev, unsigned int &nExtraNonce)
Modify the extranonce in a block.
Capture information about block/transaction validation.
double estimatePriority(int nBlocks) const
Estimate priority needed to get into the next nBlocks.
#define WAIT_LOCK(cs, name)
std::vector< PoSBlockSummary > posBlocksAudited
double GetDifficulty(const CBlockIndex *blockindex=NULL)
UniValue estimatefee(const UniValue ¶ms, bool fHelp)
@ RPC_CLIENT_NOT_CONNECTED
P2P client errors.
UniValue submitblock(const UniValue ¶ms, bool fHelp)
UniValue setgenerate(const UniValue ¶ms, bool fHelp)