trivial|doc: Some trivial housekeeping (#4059)

* Fix extra line break in CommitTransaction log message

Introduced in #3680 ebe7e80a49 (diff-b2bb174788c7409b671c46ccc86034bdR4113)

* doc: Fix `quorum sign` help

* doc: Add `getdata` to quorum commands list help

* doc: Drop "P2WSH" from signrawtransactionwithkey help

* trivial: Replace "push_back(Pair(..))" with "pushKV"

* trivial: Reorder wallet cmd-line options

* git: Add macos debug simbols to .gitignore

* trivial: Fix typos and whitespaces, drop unused stuff
This commit is contained in:
UdjinM6 2021-03-26 15:11:11 +03:00 committed by GitHub
parent fc96e34f28
commit 83663c564e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 21 additions and 21 deletions

1
.gitignore vendored
View File

@ -100,6 +100,7 @@ qrc_*.cpp
# Mac specific # Mac specific
.DS_Store .DS_Store
build build
*.dSYM
#lcov #lcov
*.gcno *.gcno

View File

@ -96,7 +96,6 @@ static void BLS_Sign_Normal(benchmark::State& state)
{ {
CBLSSecretKey secKey; CBLSSecretKey secKey;
secKey.MakeNewKey(); secKey.MakeNewKey();
CBLSPublicKey pubKey = secKey.GetPublicKey();
// Benchmark. // Benchmark.
while (state.KeepRunning()) { while (state.KeepRunning()) {

View File

@ -841,7 +841,7 @@ void ThreadImport(std::vector<fs::path> vImportFiles)
{ {
// Get all UTXOs for each MN collateral in one go so that we can fill coin cache early // Get all UTXOs for each MN collateral in one go so that we can fill coin cache early
// and reduce further locking overhead for cs_main in other parts of code inclluding GUI // and reduce further locking overhead for cs_main in other parts of code including GUI
LogPrintf("Filling coin cache with masternode UTXOs...\n"); LogPrintf("Filling coin cache with masternode UTXOs...\n");
LOCK(cs_main); LOCK(cs_main);
int64_t nStart = GetTimeMillis(); int64_t nStart = GetTimeMillis();
@ -1461,7 +1461,7 @@ bool AppInitParameterInteraction()
} }
if (gArgs.IsArgSet("-dip3params")) { if (gArgs.IsArgSet("-dip3params")) {
// Allow overriding budget parameters for testing // Allow overriding dip3 parameters for testing
if (!chainparams.MineBlocksOnDemand()) { if (!chainparams.MineBlocksOnDemand()) {
return InitError("DIP3 parameters may only be overridden on regtest."); return InitError("DIP3 parameters may only be overridden on regtest.");
} }

View File

@ -316,7 +316,7 @@ void CChainLocksHandler::TrySignChainTip()
} }
if (HasChainLock(pindexWalk->nHeight, pindexWalk->GetBlockHash())) { if (HasChainLock(pindexWalk->nHeight, pindexWalk->GetBlockHash())) {
// we don't care about islocks for TXs that are ChainLocked already // we don't care about islocks for TXs that are ChainLocked already
LogPrint(BCLog::CHAINLOCKS, "CChainLocksHandler::%s -- chainlock at height %d \n", __func__, pindexWalk->nHeight); LogPrint(BCLog::CHAINLOCKS, "CChainLocksHandler::%s -- chainlock at height %d\n", __func__, pindexWalk->nHeight);
break; break;
} }

View File

@ -695,7 +695,7 @@ void CSigningManager::ProcessRecoveredSig(const std::shared_ptr<const CRecovered
auto signHash = CLLMQUtils::BuildSignHash(*recoveredSig); auto signHash = CLLMQUtils::BuildSignHash(*recoveredSig);
LogPrint(BCLog::LLMQ, "CSigningManager::%s -- valid recSig. signHash=%s, id=%s, msgHash=%s\n", __func__, LogPrint(BCLog::LLMQ, "CSigningManager::%s -- valid recSig. signHash=%s, id=%s, msgHash=%s\n", __func__,
signHash.ToString(), recoveredSig->id .ToString(), recoveredSig->msgHash.ToString()); signHash.ToString(), recoveredSig->id.ToString(), recoveredSig->msgHash.ToString());
if (db.HasRecoveredSigForId(llmqType, recoveredSig->id)) { if (db.HasRecoveredSigForId(llmqType, recoveredSig->id)) {
CRecoveredSig otherRecoveredSig; CRecoveredSig otherRecoveredSig;

View File

@ -3732,8 +3732,8 @@ bool PeerLogicValidation::ProcessMessages(CNode* pfrom, std::atomic<bool>& inter
else else
{ {
PrintExceptionContinue(std::current_exception(), "ProcessMessages()"); PrintExceptionContinue(std::current_exception(), "ProcessMessages()");
} }
} catch (...) { } catch (...) {
PrintExceptionContinue(std::current_exception(), "ProcessMessages()"); PrintExceptionContinue(std::current_exception(), "ProcessMessages()");
} }

View File

@ -150,8 +150,8 @@ UniValue getcoinjoininfo(const JSONRPCRequest& request)
coinJoinClientManagers.at(pwallet->GetName())->GetJsonInfo(obj); coinJoinClientManagers.at(pwallet->GetName())->GetJsonInfo(obj);
obj.pushKV("keys_left", pwallet->nKeysLeftSinceAutoBackup); obj.pushKV("keys_left", pwallet->nKeysLeftSinceAutoBackup);
obj.push_back(Pair("warnings", pwallet->nKeysLeftSinceAutoBackup < COINJOIN_KEYS_THRESHOLD_WARNING obj.pushKV("warnings", pwallet->nKeysLeftSinceAutoBackup < COINJOIN_KEYS_THRESHOLD_WARNING
? "WARNING: keypool is almost depleted!" : "")); ? "WARNING: keypool is almost depleted!" : "");
#endif // ENABLE_WALLET #endif // ENABLE_WALLET
return obj; return obj;

View File

@ -908,7 +908,7 @@ UniValue signrawtransactionwithkey(const JSONRPCRequest& request)
" \"txid\":\"id\", (string, required) The transaction id\n" " \"txid\":\"id\", (string, required) The transaction id\n"
" \"vout\":n, (numeric, required) The output number\n" " \"vout\":n, (numeric, required) The output number\n"
" \"scriptPubKey\": \"hex\", (string, required) script key\n" " \"scriptPubKey\": \"hex\", (string, required) script key\n"
" \"redeemScript\": \"hex\", (string, required for P2SH or P2WSH) redeem script\n" " \"redeemScript\": \"hex\", (string, required for P2SH) redeem script\n"
" \"amount\": value (numeric, required) The amount spent\n" " \"amount\": value (numeric, required) The amount spent\n"
" }\n" " }\n"
" ,...\n" " ,...\n"

View File

@ -287,7 +287,7 @@ UniValue quorum_memberof(const JSONRPCRequest& request)
void quorum_sign_help() void quorum_sign_help()
{ {
throw std::runtime_error( throw std::runtime_error(
"quorum sign llmqType \"id\" \"msgHash\" ( \"quorumHash\" )\n" "quorum sign llmqType \"id\" \"msgHash\" ( \"quorumHash\" submit )\n"
"Threshold-sign a message\n" "Threshold-sign a message\n"
"\nArguments:\n" "\nArguments:\n"
"1. llmqType (int, required) LLMQ type.\n" "1. llmqType (int, required) LLMQ type.\n"
@ -616,6 +616,7 @@ UniValue quorum_getdata(const JSONRPCRequest& request)
" getrecsig - Get a recovered signature\n" " getrecsig - Get a recovered signature\n"
" isconflicting - Test if a conflict exists\n" " isconflicting - Test if a conflict exists\n"
" selectquorum - Return the quorum that would/should sign a request\n" " selectquorum - Return the quorum that would/should sign a request\n"
" getdata - Request quorum data from other masternodes in the quorum\n"
); );
} }

View File

@ -246,7 +246,6 @@ uint64_t nPruneTarget = 0;
int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE; int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE;
std::atomic<bool> fDIP0001ActiveAtTip{false}; std::atomic<bool> fDIP0001ActiveAtTip{false};
std::atomic<bool> fDIP0003ActiveAtTip{false};
uint256 hashAssumeValid; uint256 hashAssumeValid;
arith_uint256 nMinimumChainWork; arith_uint256 nMinimumChainWork;
@ -2532,7 +2531,7 @@ bool static FlushStateToDisk(const CChainParams& chainparams, CValidationState &
} }
int64_t nMempoolSizeMax = gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; int64_t nMempoolSizeMax = gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000;
int64_t cacheSize = pcoinsTip->DynamicMemoryUsage(); int64_t cacheSize = pcoinsTip->DynamicMemoryUsage();
cacheSize += evoDb->GetMemoryUsage(); cacheSize += evoDb->GetMemoryUsage();
int64_t nTotalSpace = nCoinCacheUsage + std::max<int64_t>(nMempoolSizeMax - nMempoolUsage, 0); int64_t nTotalSpace = nCoinCacheUsage + std::max<int64_t>(nMempoolSizeMax - nMempoolUsage, 0);
// The cache is large and we're within 10% and 10 MiB of the limit, but we have time now (not in the middle of a block processing). // The cache is large and we're within 10% and 10 MiB of the limit, but we have time now (not in the middle of a block processing).
bool fCacheLarge = mode == FlushStateMode::PERIODIC && cacheSize > std::max((9 * nTotalSpace) / 10, nTotalSpace - MAX_BLOCK_COINSDB_USAGE * 1024 * 1024); bool fCacheLarge = mode == FlushStateMode::PERIODIC && cacheSize > std::max((9 * nTotalSpace) / 10, nTotalSpace - MAX_BLOCK_COINSDB_USAGE * 1024 * 1024);
@ -2586,9 +2585,9 @@ bool static FlushStateToDisk(const CChainParams& chainparams, CValidationState &
// Flush the chainstate (which may refer to block index entries). // Flush the chainstate (which may refer to block index entries).
if (!pcoinsTip->Flush()) if (!pcoinsTip->Flush())
return AbortNode(state, "Failed to write to coin database"); return AbortNode(state, "Failed to write to coin database");
if (!evoDb->CommitRootTransaction()) { if (!evoDb->CommitRootTransaction()) {
return AbortNode(state, "Failed to commit EvoDB"); return AbortNode(state, "Failed to commit EvoDB");
} }
nLastFlush = nNow; nLastFlush = nNow;
} }
} }

View File

@ -71,12 +71,12 @@ void WalletInit::AddWalletOptions() const
gArgs.AddArg("-spendzeroconfchange", strprintf("Spend unconfirmed change when sending transactions (default: %u)", DEFAULT_SPEND_ZEROCONF_CHANGE), false, OptionsCategory::WALLET); gArgs.AddArg("-spendzeroconfchange", strprintf("Spend unconfirmed change when sending transactions (default: %u)", DEFAULT_SPEND_ZEROCONF_CHANGE), false, OptionsCategory::WALLET);
gArgs.AddArg("-upgradewallet", "Upgrade wallet to latest format on startup", false, OptionsCategory::WALLET); gArgs.AddArg("-upgradewallet", "Upgrade wallet to latest format on startup", false, OptionsCategory::WALLET);
gArgs.AddArg("-wallet=<path>", "Specify wallet database path. Can be specified multiple times to load multiple wallets. Path is interpreted relative to <walletdir> if it is not absolute, and will be created if it does not exist (as a directory containing a wallet.dat file and log files). For backwards compatibility this will also accept names of existing data files in <walletdir>.)", false, OptionsCategory::WALLET); gArgs.AddArg("-wallet=<path>", "Specify wallet database path. Can be specified multiple times to load multiple wallets. Path is interpreted relative to <walletdir> if it is not absolute, and will be created if it does not exist (as a directory containing a wallet.dat file and log files). For backwards compatibility this will also accept names of existing data files in <walletdir>.)", false, OptionsCategory::WALLET);
gArgs.AddArg("-walletbackupsdir=<dir>", "Specify full path to directory for automatic wallet backups (must exist)", false, OptionsCategory::WALLET);
gArgs.AddArg("-walletbroadcast", strprintf("Make the wallet broadcast transactions (default: %u)", DEFAULT_WALLETBROADCAST), false, OptionsCategory::WALLET); gArgs.AddArg("-walletbroadcast", strprintf("Make the wallet broadcast transactions (default: %u)", DEFAULT_WALLETBROADCAST), false, OptionsCategory::WALLET);
gArgs.AddArg("-walletdir=<dir>", "Specify directory to hold wallets (default: <datadir>/wallets if it exists, otherwise <datadir>)", false, OptionsCategory::WALLET); gArgs.AddArg("-walletdir=<dir>", "Specify directory to hold wallets (default: <datadir>/wallets if it exists, otherwise <datadir>)", false, OptionsCategory::WALLET);
gArgs.AddArg("-walletnotify=<cmd>", "Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)", false, OptionsCategory::WALLET); gArgs.AddArg("-walletnotify=<cmd>", "Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)", false, OptionsCategory::WALLET);
gArgs.AddArg("-zapwallettxes=<mode>", "Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup" gArgs.AddArg("-zapwallettxes=<mode>", "Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup"
" (1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)", false, OptionsCategory::WALLET); " (1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)", false, OptionsCategory::WALLET);
gArgs.AddArg("-walletbackupsdir=<dir>", "Specify full path to directory for automatic wallet backups (must exist)", false, OptionsCategory::WALLET);
gArgs.AddArg("-discardfee=<amt>", strprintf("The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). " gArgs.AddArg("-discardfee=<amt>", strprintf("The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). "
"Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target", "Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target",
@ -96,9 +96,9 @@ void WalletInit::AddWalletOptions() const
gArgs.AddArg("-keepass", strprintf("Use KeePass 2 integration using KeePassHttp plugin (default: %u)", 0), false, OptionsCategory::WALLET_KEEPASS); gArgs.AddArg("-keepass", strprintf("Use KeePass 2 integration using KeePassHttp plugin (default: %u)", 0), false, OptionsCategory::WALLET_KEEPASS);
gArgs.AddArg("-keepassid=<id>", "KeePassHttp id for the established association", false, OptionsCategory::WALLET_KEEPASS); gArgs.AddArg("-keepassid=<id>", "KeePassHttp id for the established association", false, OptionsCategory::WALLET_KEEPASS);
gArgs.AddArg("-keepasskey=<key>", "KeePassHttp key for AES encrypted communication with KeePass", false, OptionsCategory::WALLET_KEEPASS);
gArgs.AddArg("-keepassname=<name>", "Name to construct url for KeePass entry that stores the wallet passphrase", false, OptionsCategory::WALLET_KEEPASS); gArgs.AddArg("-keepassname=<name>", "Name to construct url for KeePass entry that stores the wallet passphrase", false, OptionsCategory::WALLET_KEEPASS);
gArgs.AddArg("-keepassport=<port>", strprintf("Connect to KeePassHttp on port <port> (default: %u)", DEFAULT_KEEPASS_HTTP_PORT), false, OptionsCategory::WALLET_KEEPASS); gArgs.AddArg("-keepassport=<port>", strprintf("Connect to KeePassHttp on port <port> (default: %u)", DEFAULT_KEEPASS_HTTP_PORT), false, OptionsCategory::WALLET_KEEPASS);
gArgs.AddArg("-keepasskey=<key>", "KeePassHttp key for AES encrypted communication with KeePass", false, OptionsCategory::WALLET_KEEPASS);
gArgs.AddArg("-enablecoinjoin", strprintf("Enable use of CoinJoin for funds stored in this wallet (0-1, default: %u)", 0), false, OptionsCategory::WALLET_COINJOIN); gArgs.AddArg("-enablecoinjoin", strprintf("Enable use of CoinJoin for funds stored in this wallet (0-1, default: %u)", 0), false, OptionsCategory::WALLET_COINJOIN);
gArgs.AddArg("-coinjoinamount=<n>", strprintf("Target CoinJoin balance (%u-%u, default: %u)", MIN_COINJOIN_AMOUNT, MAX_COINJOIN_AMOUNT, DEFAULT_COINJOIN_AMOUNT), false, OptionsCategory::WALLET_COINJOIN); gArgs.AddArg("-coinjoinamount=<n>", strprintf("Target CoinJoin balance (%u-%u, default: %u)", MIN_COINJOIN_AMOUNT, MAX_COINJOIN_AMOUNT, DEFAULT_COINJOIN_AMOUNT), false, OptionsCategory::WALLET_COINJOIN);

View File

@ -221,7 +221,7 @@ void CWallet::DeriveNewChildKey(WalletBatch &batch, const CKeyMetadata& metadata
} }
if (!DecryptHDChain(hdChainTmp)) if (!DecryptHDChain(hdChainTmp))
throw std::runtime_error(std::string(__func__) + ": DecryptHDChainSeed failed"); throw std::runtime_error(std::string(__func__) + ": DecryptHDChain failed");
// make sure seed matches this chain // make sure seed matches this chain
if (hdChainTmp.GetID() != hdChainTmp.GetSeedHash()) if (hdChainTmp.GetID() != hdChainTmp.GetSeedHash())
throw std::runtime_error(std::string(__func__) + ": Wrong HD chain!"); throw std::runtime_error(std::string(__func__) + ": Wrong HD chain!");
@ -300,7 +300,7 @@ bool CWallet::GetKey(const CKeyID &address, CKey& keyOut) const
if (!GetHDChain(hdChainCurrent)) if (!GetHDChain(hdChainCurrent))
throw std::runtime_error(std::string(__func__) + ": GetHDChain failed"); throw std::runtime_error(std::string(__func__) + ": GetHDChain failed");
if (!DecryptHDChain(hdChainCurrent)) if (!DecryptHDChain(hdChainCurrent))
throw std::runtime_error(std::string(__func__) + ": DecryptHDChainSeed failed"); throw std::runtime_error(std::string(__func__) + ": DecryptHDChain failed");
// make sure seed matches this chain // make sure seed matches this chain
if (hdChainCurrent.GetID() != hdChainCurrent.GetSeedHash()) if (hdChainCurrent.GetID() != hdChainCurrent.GetSeedHash())
throw std::runtime_error(std::string(__func__) + ": Wrong HD chain!"); throw std::runtime_error(std::string(__func__) + ": Wrong HD chain!");
@ -4033,7 +4033,7 @@ bool CWallet::CommitTransaction(CTransactionRef tx, mapValue_t mapValue, std::ve
wtxNew.fTimeReceivedIsTxTime = true; wtxNew.fTimeReceivedIsTxTime = true;
wtxNew.fFromMe = true; wtxNew.fFromMe = true;
LogPrintf("CommitTransaction:\n%s\n", wtxNew.tx->ToString()); LogPrintf("CommitTransaction:\n%s", wtxNew.tx->ToString()); /* Continued */
{ {
// Take key pair from key pool so it won't be used again // Take key pair from key pool so it won't be used again
reservekey.KeepKey(); reservekey.KeepKey();