diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index cd691e151ca4a..29c4c7b9be14f 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -75,7 +75,7 @@ static void SetupCliArgs(ArgsManager& argsman) argsman.AddArg("-conf=", strprintf("Specify configuration file. Relative paths will be prefixed by datadir location. (default: %s)", BITCOIN_CONF_FILENAME), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-datadir=", "Specify data directory", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-generate", strprintf("Generate blocks immediately, equivalent to RPC getnewaddress followed by RPC generatetoaddress. Optional positional integer arguments are number of blocks to generate (default: %s) and maximum iterations to try (default: %s), equivalent to RPC generatetoaddress nblocks and maxtries arguments. Example: dash-cli -generate 4 1000", DEFAULT_NBLOCKS, DEFAULT_MAX_TRIES), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); - argsman.AddArg("-addrinfo", "Get the number of addresses known to the node, per network and total.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); + argsman.AddArg("-addrinfo", "Get the number of addresses known to the node, per network and total, after filtering for quality and recency. The total number of addresses known to the node may be higher.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-getinfo", "Get general information from the remote server. Note that unlike server-side RPC calls, the results of -getinfo is the result of multiple non-atomic requests. Some entries in the result may represent results from different states (e.g. wallet balance may be as of a different block from the chain state reported)", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-netinfo", "Get network peer connection information from the remote server. An optional integer argument from 0 to 4 can be passed for different peers listings (default: 0). Pass \"help\" for detailed help documentation.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); @@ -640,8 +640,9 @@ class NetinfoRequestHandler : public BaseRequestHandler "Suggestion: use with the Linux watch(1) command for a live dashboard; see example below.\n\n" "Arguments:\n" + strprintf("1. level (integer 0-%d, optional) Specify the info level of the peers dashboard (default 0):\n", MAX_DETAIL_LEVEL) + - " 0 - Connection counts and local addresses\n" - " 1 - Like 0 but with a peers listing (without address or version columns)\n" + " 0 - Peer counts for each reachable network as well as for block relay peers\n" + " and manual peers, and the list of local addresses and ports\n" + " 1 - Like 0 but preceded by a peers listing (without address and version columns)\n" " 2 - Like 1 but with an address column\n" " 3 - Like 1 but with a version column\n" " 4 - Like 1 but with both address and version columns\n" @@ -680,13 +681,13 @@ class NetinfoRequestHandler : public BaseRequestHandler " id Peer index, in increasing order of peer connections since node startup\n" " address IP address and port of the peer\n" " version Peer version and subversion concatenated, e.g. \"70016/Satoshi:21.0.0/\"\n\n" - "* The connection counts table displays the number of peers by direction, network, and the totals\n" - " for each, as well as two special outbound columns for block relay peers and manual peers.\n\n" + "* The peer counts table displays the number of peers for each reachable network as well as\n" + " the number of block relay peers and manual peers.\n\n" "* The local addresses table lists each local address broadcast by the node, the port, and the score.\n\n" "Examples:\n\n" - "Connection counts and local addresses only\n" + "Peer counts table of reachable networks and list of local addresses\n" "> dash-cli -netinfo\n\n" - "Compact peers listing\n" + "The same, preceded by a peers listing without address and version columns\n" "> dash-cli -netinfo 1\n\n" "Full dashboard\n" + strprintf("> dash-cli -netinfo %d\n\n", MAX_DETAIL_LEVEL) + diff --git a/src/bitcoin-wallet.cpp b/src/bitcoin-wallet.cpp index 176b455ce90d8..8e7c1490fd14b 100644 --- a/src/bitcoin-wallet.cpp +++ b/src/bitcoin-wallet.cpp @@ -56,7 +56,7 @@ static bool WalletAppInit(ArgsManager& args, int argc, char* argv[]) strUsage += "\n" "dash-wallet is an offline tool for creating and interacting with " PACKAGE_NAME " wallet files.\n" "By default dash-wallet will act on wallets in the default mainnet wallet directory in the datadir.\n" - "To change the target wallet, use the -datadir, -wallet and -testnet/-regtest arguments.\n\n" + "To change the target wallet, use the -datadir, -wallet and -regtest/-testnet arguments.\n\n" "Usage:\n" " dash-wallet [options] \n"; strUsage += "\n" + args.GetHelpMessage(); diff --git a/src/policy/feerate.h b/src/policy/feerate.h index df700dfed56d8..e52d29454fe3a 100644 --- a/src/policy/feerate.h +++ b/src/policy/feerate.h @@ -24,34 +24,38 @@ enum class FeeEstimateMode { }; /** - * Fee rate in satoshis per kilobyte: CAmount / kB + * Fee rate in satoshis per kilovirtualbyte: CAmount / kvB */ class CFeeRate { private: - CAmount nSatoshisPerK; // unit is satoshis-per-1,000-bytes + /** Fee rate in sat/kvB (satoshis per 1000 virtualbytes) */ + CAmount nSatoshisPerK; public: - /** Fee rate of 0 satoshis per kB */ + /** Fee rate of 0 satoshis per kvB */ CFeeRate() : nSatoshisPerK(0) { } template explicit CFeeRate(const I _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) { // We've previously had bugs creep in from silent double->int conversion... static_assert(std::is_integral::value, "CFeeRate should be used without floats"); } - /** Constructor for a fee rate in satoshis per kB (duff/kB). + + /** + * Construct a fee rate from a fee in satoshis and a vsize in vB. * - * Passing a num_bytes value of COIN (1e8) returns a fee rate in satoshis per B (sat/B), - * e.g. (nFeePaid * 1e8 / 1e3) == (nFeePaid / 1e5), - * where 1e5 is the ratio to convert from DASH/kB to sat/B. + * param@[in] nFeePaid The fee paid by a transaction, in satoshis + * param@[in] num_bytes The vsize of a transaction, in vbytes. */ CFeeRate(const CAmount& nFeePaid, uint32_t num_bytes); + /** - * Return the fee in satoshis for the given size in bytes. + * Return the fee in satoshis for the given size in vbytes. */ CAmount GetFee(uint32_t num_bytes) const; + /** - * Return the fee in satoshis for a size of 1000 bytes + * Return the fee in satoshis for a vsize of 1000 vbytes */ CAmount GetFeePerK() const { return nSatoshisPerK; } friend bool operator<(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK < b.nSatoshisPerK; } diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 5c3890a0c9671..d6013a6a4c037 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1632,7 +1632,7 @@ static RPCHelpMan verifychain() }, [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue { - const int check_level(request.params[0].isNull() ? DEFAULT_CHECKLEVEL : request.params[0].get_int()); + const int check_level{request.params[0].isNull() ? DEFAULT_CHECKLEVEL : request.params[0].get_int()}; const int check_depth{request.params[1].isNull() ? DEFAULT_CHECKBLOCKS : request.params[1].get_int()}; const NodeContext& node = EnsureAnyNodeContext(request.context); diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index ecb1441ee6d7b..1c4f479410e3e 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -922,7 +922,9 @@ static RPCHelpMan setnetworkactive() static RPCHelpMan getnodeaddresses() { return RPCHelpMan{"getnodeaddresses", - "\nReturn known addresses, which can potentially be used to find new nodes in the network.\n", + "Return known addresses, after filtering for quality and recency.\n" + "These can potentially be used to find new peers in the network.\n" + "The total number of addresses known to the node may be higher.", { {"count", RPCArg::Type::NUM, RPCArg::Default{1}, "The maximum number of addresses to return. Specify 0 to return all known addresses."}, {"network", RPCArg::Type::STR, RPCArg::DefaultHint{"all networks"}, "Return only addresses of the specified network. Can be one of: " + Join(GetNetworkNames(), ", ") + "."}, diff --git a/src/validation.h b/src/validation.h index fd9bf01d89985..1644549a3ce08 100644 --- a/src/validation.h +++ b/src/validation.h @@ -104,7 +104,7 @@ static const int DEFAULT_STOPATHEIGHT = 0; /** Block files containing a block-height within MIN_BLOCKS_TO_KEEP of ActiveChain().Tip() will not be pruned. */ static const unsigned int MIN_BLOCKS_TO_KEEP = 288; static const signed int DEFAULT_CHECKBLOCKS = 6; -static const unsigned int DEFAULT_CHECKLEVEL = 3; +static constexpr int DEFAULT_CHECKLEVEL{3}; // Require that user allocate at least 945 MiB for block & undo files (blk???.dat and rev???.dat) // At 2B MiB per block, 288 blocks = 576 MiB. diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 346a2ec1999bd..874b000c868b7 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1019,7 +1019,8 @@ bool CWallet::LoadToWallet(const uint256& hash, const UpdateWalletTxFn& fill_wtx if (!fill_wtx(wtx, ins.second)) { return false; } - // If wallet doesn't have a chain (e.g dash-wallet), don't bother to update txn. + // If wallet doesn't have a chain (e.g when using dash-wallet tool), + // don't bother to update txn. if (HaveChain()) { bool active; int height;