From 5b369a19d58be9efde133cce545a174a07fc6e10 Mon Sep 17 00:00:00 2001 From: "W. J. van der Laan" Date: Tue, 20 Jul 2021 20:34:17 +0200 Subject: [PATCH 1/4] Merge bitcoin/bitcoin#22507: doc: Adjust commit message template for the guix.sigs repo fafade9c79f55c186c1938ce3e27077d12dee6c5 doc: Adjust commit message template for the guix.sigs repo (MarcoFalke) Pull request description: Seems to be the most common template used, so adjust this here, too. ACKs for top commit: laanwj: ACK fafade9c79f55c186c1938ce3e27077d12dee6c5 hebasto: re-ACK fafade9c79f55c186c1938ce3e27077d12dee6c5 Tree-SHA512: 20477d14ecfad94f3b28b94786a4c0d98df539360d0c1deefa94766064a7d0700c849e54d6b251f922e135fcfa964ada0c724090f7f92b459ea39f7c3ca8c65d --- doc/release-process.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/release-process.md b/doc/release-process.md index 355ca16159fc6..f9b01fae20371 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -178,7 +178,7 @@ Commit your signature for the signed macOS/Windows binaries: ```sh pushd ./guix.sigs git add "${VERSION}/${SIGNER}"/all.SHA256SUMS{,.asc} -git commit -m "Add ${SIGNER} ${VERSION} signed binaries signatures" +git commit -m "Add attestations by ${SIGNER} for ${VERSION} codesigned" git push # Assuming you can push to the guix.sigs tree popd ``` From 10dd79cb219a9a59246bcaa7699c221f9a5203a3 Mon Sep 17 00:00:00 2001 From: fanquake Date: Tue, 25 Jan 2022 10:51:29 +0800 Subject: [PATCH 2/4] Merge bitcoin/bitcoin#21464: Mempool Update Cut-Through Optimization c5b36b1c1b11f04e5da7fb44183f61d09a14e40d Mempool Update Cut-Through Optimization (Jeremy Rubin) c49daf9885e86ba08acdc8332d2a34bc5951a487 [TESTS] Increase limitancestorcount in tournament RPC test to showcase improved algorithm (Jeremy Rubin) Pull request description: Often when we're updating mempool entries we update entries that we ultimately end up removing the updated entries shortly thereafter. This patch makes it so that we filter for such entries a bit earlier in processing, which yields a mild improvement for these cases, and is negligible overhead otherwise. There's potential for a better -- but more sophisticated -- algorithm that can be used taking advantage of epochs, but I figured it is better to do something that is simple and works first and upgrade it later as the other epoch mempool work proceeds as it makes the patches for the epoch algorithm simpler to understand, so you can consider this as preparatory work. It could either go in now if it is not controversial, or we could wait until the other patch is ready to go. ACKs for top commit: instagibbs: reACK c5b36b1 sipa: utACK c5b36b1c1b11f04e5da7fb44183f61d09a14e40d mzumsande: Code Review ACK c5b36b1c1b11f04e5da7fb44183f61d09a14e40d Tree-SHA512: 78b16864f77a637d8a68a65e23c019a9757d8b2243486728ef601d212ae482f6084cf8e69d810958c356f1803178046e4697207ba40d6d10529ca57de647fae6 --- src/txmempool.cpp | 32 ++++++---- src/txmempool.h | 68 +++++++++++++++------- src/validation.cpp | 4 +- test/functional/mempool_updatefromblock.py | 2 +- 4 files changed, 73 insertions(+), 33 deletions(-) diff --git a/src/txmempool.cpp b/src/txmempool.cpp index d4adf717ce344..9eb047d868b0b 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -124,10 +124,9 @@ size_t CTxMemPoolEntry::GetTxSize() const return GetVirtualTransactionSize(nTxSize, sigOpCount); } -// Update the given tx for any in-mempool descendants. -// Assumes that CTxMemPool::m_children is correct for the given tx and all -// descendants. -void CTxMemPool::UpdateForDescendants(txiter updateIt, cacheMap &cachedDescendants, const std::set &setExclude) +void CTxMemPool::UpdateForDescendants(txiter updateIt, cacheMap& cachedDescendants, + const std::set& setExclude, std::set& descendants_to_remove, + uint64_t ancestor_size_limit, uint64_t ancestor_count_limit) { CTxMemPoolEntry::Children stageEntries, descendants; stageEntries = updateIt->GetMemPoolChildrenConst(); @@ -164,17 +163,18 @@ void CTxMemPool::UpdateForDescendants(txiter updateIt, cacheMap &cachedDescendan cachedDescendants[updateIt].insert(mapTx.iterator_to(descendant)); // Update ancestor state for each descendant mapTx.modify(mapTx.iterator_to(descendant), update_ancestor_state(updateIt->GetTxSize(), updateIt->GetModifiedFee(), 1, updateIt->GetSigOpCount())); + // Don't directly remove the transaction here -- doing so would + // invalidate iterators in cachedDescendants. Mark it for removal + // by inserting into descendants_to_remove. + if (descendant.GetCountWithAncestors() > ancestor_count_limit || descendant.GetSizeWithAncestors() > ancestor_size_limit) { + descendants_to_remove.insert(descendant.GetTx().GetHash()); + } } } mapTx.modify(updateIt, update_descendant_state(modifySize, modifyFee, modifyCount)); } -// vHashesToUpdate is the set of transaction hashes from a disconnected block -// which has been re-added to the mempool. -// for each entry, look for descendants that are outside vHashesToUpdate, and -// add fee/size information for such descendants to the parent. -// for each such descendant, also update the ancestor state to include the parent. -void CTxMemPool::UpdateTransactionsFromBlock(const std::vector &vHashesToUpdate) +void CTxMemPool::UpdateTransactionsFromBlock(const std::vector &vHashesToUpdate, uint64_t ancestor_size_limit, uint64_t ancestor_count_limit) { AssertLockHeld(cs); // For each entry in vHashesToUpdate, store the set of in-mempool, but not @@ -186,6 +186,8 @@ void CTxMemPool::UpdateTransactionsFromBlock(const std::vector &vHashes // accounted for in the state of their ancestors) std::set setAlreadyIncluded(vHashesToUpdate.begin(), vHashesToUpdate.end()); + std::set descendants_to_remove; + // Iterate in reverse, so that whenever we are looking at a transaction // we are sure that all in-mempool descendants have already been processed. // This maximizes the benefit of the descendant cache and guarantees that @@ -215,7 +217,15 @@ void CTxMemPool::UpdateTransactionsFromBlock(const std::vector &vHashes } } } // release epoch guard for UpdateForDescendants - UpdateForDescendants(it, mapMemPoolDescendantsToUpdate, setAlreadyIncluded); + UpdateForDescendants(it, mapMemPoolDescendantsToUpdate, setAlreadyIncluded, descendants_to_remove, ancestor_size_limit, ancestor_count_limit); + } + + for (const auto& txid : descendants_to_remove) { + // This txid may have been removed already in a prior call to removeRecursive. + // Therefore we ensure it is not yet removed already. + if (const std::optional txiter = GetIter(txid)) { + removeRecursive((*txiter)->GetTx(), MemPoolRemovalReason::SIZELIMIT); + } } } diff --git a/src/txmempool.h b/src/txmempool.h index 80e12f4e7df58..f1f93c8a7d5a8 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -680,16 +680,25 @@ class CTxMemPool */ void RemoveStaged(setEntries& stage, bool updateDescendants, MemPoolRemovalReason reason) EXCLUSIVE_LOCKS_REQUIRED(cs); - /** When adding transactions from a disconnected block back to the mempool, - * new mempool entries may have children in the mempool (which is generally - * not the case when otherwise adding transactions). - * UpdateTransactionsFromBlock() will find child transactions and update the - * descendant state for each transaction in vHashesToUpdate (excluding any - * child transactions present in vHashesToUpdate, which are already accounted - * for). Note: vHashesToUpdate should be the set of transactions from the - * disconnected block that have been accepted back into the mempool. + /** UpdateTransactionsFromBlock is called when adding transactions from a + * disconnected block back to the mempool, new mempool entries may have + * children in the mempool (which is generally not the case when otherwise + * adding transactions). + * @post updated descendant state for descendants of each transaction in + * vHashesToUpdate (excluding any child transactions present in + * vHashesToUpdate, which are already accounted for). Updated state + * includes add fee/size information for such descendants to the + * parent and updated ancestor state to include the parent. + * + * @param[in] vHashesToUpdate The set of txids from the + * disconnected block that have been accepted back into the mempool. + * @param[in] ancestor_size_limit The maximum allowed size in virtual + * bytes of an entry and its ancestors + * @param[in] ancestor_count_limit The maximum allowed number of + * transactions including the entry and its ancestors. */ - void UpdateTransactionsFromBlock(const std::vector& vHashesToUpdate) EXCLUSIVE_LOCKS_REQUIRED(cs, cs_main) LOCKS_EXCLUDED(m_epoch); + void UpdateTransactionsFromBlock(const std::vector& vHashesToUpdate, + uint64_t ancestor_size_limit, uint64_t ancestor_count_limit) EXCLUSIVE_LOCKS_REQUIRED(cs, cs_main) LOCKS_EXCLUDED(m_epoch); /** Try to calculate all in-mempool ancestors of entry. * (these are all calculated including the tx itself) @@ -836,19 +845,38 @@ class CTxMemPool /** UpdateForDescendants is used by UpdateTransactionsFromBlock to update * the descendants for a single transaction that has been added to the * mempool but may have child transactions in the mempool, eg during a - * chain reorg. setExclude is the set of descendant transactions in the - * mempool that must not be accounted for (because any descendants in - * setExclude were added to the mempool after the transaction being - * updated and hence their state is already reflected in the parent - * state). + * chain reorg. + * + * @pre CTxMemPool::m_children is correct for the given tx and all + * descendants. + * @pre cachedDescendants is an accurate cache where each entry has all + * descendants of the corresponding key, including those that should + * be removed for violation of ancestor limits. + * @post if updateIt has any non-excluded descendants, cachedDescendants has + * a new cache line for updateIt. + * @post descendants_to_remove has a new entry for any descendant which exceeded + * ancestor limits relative to updateIt. * - * cachedDescendants will be updated with the descendants of the transaction - * being updated, so that future invocations don't need to walk the - * same transaction again, if encountered in another transaction chain. + * @param[in] updateIt the entry to update for its descendants + * @param[in,out] cachedDescendants a cache where each line corresponds to all + * descendants. It will be updated with the descendants of the transaction + * being updated, so that future invocations don't need to walk the same + * transaction again, if encountered in another transaction chain. + * @param[in] setExclude the set of descendant transactions in the mempool + * that must not be accounted for (because any descendants in setExclude + * were added to the mempool after the transaction being updated and hence + * their state is already reflected in the parent state). + * @param[out] descendants_to_remove Populated with the txids of entries that + * exceed ancestor limits. It's the responsibility of the caller to + * removeRecursive them. + * @param[in] ancestor_size_limit the max number of ancestral bytes allowed + * for any descendant + * @param[in] ancestor_count_limit the max number of ancestor transactions + * allowed for any descendant */ - void UpdateForDescendants(txiter updateIt, - cacheMap &cachedDescendants, - const std::set &setExclude) EXCLUSIVE_LOCKS_REQUIRED(cs); + void UpdateForDescendants(txiter updateIt, cacheMap& cachedDescendants, + const std::set& setExclude, std::set& descendants_to_remove, + uint64_t ancestor_size_limit, uint64_t ancestor_count_limit) EXCLUSIVE_LOCKS_REQUIRED(cs); /** Update ancestors of hash to add/remove it as a descendant transaction. */ void UpdateAncestorsOf(bool add, txiter hash, setEntries &setAncestors) EXCLUSIVE_LOCKS_REQUIRED(cs); /** Set ancestor state for an entry */ diff --git a/src/validation.cpp b/src/validation.cpp index 2fabcc6e45b80..d7e5625f87025 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -357,7 +357,9 @@ void CChainState::MaybeUpdateMempoolForReorg( // previously-confirmed transactions back to the mempool. // UpdateTransactionsFromBlock finds descendants of any transactions in // the disconnectpool that were added back and cleans up the mempool state. - m_mempool->UpdateTransactionsFromBlock(vHashUpdate); + const uint64_t ancestor_count_limit = gArgs.GetArg("-limitancestorcount", DEFAULT_ANCESTOR_LIMIT); + const uint64_t ancestor_size_limit = gArgs.GetArg("-limitancestorsize", DEFAULT_ANCESTOR_SIZE_LIMIT) * 1000; + m_mempool->UpdateTransactionsFromBlock(vHashUpdate, ancestor_size_limit, ancestor_count_limit); // Predicate to use for filtering transactions in removeForReorg. // Checks whether the transaction is still final and, if it spends a coinbase output, mature. diff --git a/test/functional/mempool_updatefromblock.py b/test/functional/mempool_updatefromblock.py index 22f136d1a5c33..f2e5aa1a8985a 100755 --- a/test/functional/mempool_updatefromblock.py +++ b/test/functional/mempool_updatefromblock.py @@ -17,7 +17,7 @@ class MempoolUpdateFromBlockTest(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 1 - self.extra_args = [['-limitdescendantsize=1000', '-limitancestorsize=1000']] + self.extra_args = [['-limitdescendantsize=1000', '-limitancestorsize=1000', '-limitancestorcount=100']] def skip_test_if_missing_module(self): self.skip_if_no_wallet() From b8951febd4b9df01bf8cb16794217829c0499ee1 Mon Sep 17 00:00:00 2001 From: merge-script Date: Tue, 21 Sep 2021 09:18:01 +0200 Subject: [PATCH 3/4] Merge bitcoin/bitcoin#23050: log: change an incorrect fee to fee rate, and vice-versa c17f554fcc63e9e1f6ba64750df475d8a8d11f2e Fix BlockAssembler::AddToBlock, CTxMemPool::PrioritiseTransaction logging (Jon Atack) Pull request description: This is a tale of two fees, er, fee rates... indeed, one is misdescribed as a fee, and the other is incorrectly called a fee rate. From this review discussion: https://github.com/bitcoin/bitcoin/pull/22689#discussion_r695866211 (thanks to John Newbery). ACKs for top commit: laanwj: Code review ACK c17f554fcc63e9e1f6ba64750df475d8a8d11f2e Tree-SHA512: 3d9df3209a72562c5f9bbf815923d5b089d04491b8d19caa2c04158c501b47ef01e47f1c32d89adcbaf3c6357329507f65b4bb2963214c3451bbfa61ac812530 --- src/node/miner.cpp | 2 +- src/txmempool.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/miner.cpp b/src/node/miner.cpp index 46518ae8ef109..a6e76e3ccd012 100644 --- a/src/node/miner.cpp +++ b/src/node/miner.cpp @@ -336,7 +336,7 @@ void BlockAssembler::AddToBlock(CTxMemPool::txiter iter) bool fPrintPriority = gArgs.GetBoolArg("-printpriority", DEFAULT_PRINTPRIORITY); if (fPrintPriority) { - LogPrintf("fee %s txid %s\n", + LogPrintf("fee rate %s txid %s\n", CFeeRate(iter->GetModifiedFee(), iter->GetTxSize()).ToString(), iter->GetTx().GetHash().ToString()); } diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 9eb047d868b0b..1416dc3b573fa 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -1480,7 +1480,7 @@ void CTxMemPool::PrioritiseTransaction(const uint256& hash, const CAmount& nFeeD ++nTransactionsUpdated; } } - LogPrint(BCLog::MEMPOOL, "PrioritiseTransaction: %s feerate += %s\n", hash.ToString(), FormatMoney(nFeeDelta)); + LogPrint(BCLog::MEMPOOL, "PrioritiseTransaction: %s fee += %s\n", hash.ToString(), FormatMoney(nFeeDelta)); } void CTxMemPool::ApplyDelta(const uint256& hash, CAmount &nFeeDelta) const From 7972af9294ff18b5cace5f6a6a2bae63769cc4e1 Mon Sep 17 00:00:00 2001 From: laanwj <126646+laanwj@users.noreply.github.com> Date: Tue, 22 Feb 2022 12:38:12 +0100 Subject: [PATCH 4/4] (partial) Merge bitcoin/bitcoin#24367: User-facing content and codebase doc fixups from transifex translator feedback 48742693acc9de837735674057c9aae2fe90bd1d Replace "can not" with "cannot" in docs, user messages, and tests (Jon Atack) e670edd43441ecb6e5978d65348501c57d856030 User-facing content fixups from transifex translator feedback (Jon Atack) Pull request description: Closes #24366. ACKs for top commit: laanwj: Code review re-ACK 48742693acc9de837735674057c9aae2fe90bd1d hebasto: re-ACK 48742693acc9de837735674057c9aae2fe90bd1d, only suggested change since my previous [review](https://github.com/bitcoin/bitcoin/pull/24367#pullrequestreview-885938219). Tree-SHA512: 4dcdcb417251a413e65fab6070515e13a1267c8e0dbcf521386b842511391f24c84a0c2168fe13458c977682034466509bf2a3453719d4d94d3c568fd9f4adb4 --- contrib/guix/guix-build | 2 +- doc/developer-notes.md | 4 ++-- src/net.cpp | 2 +- src/qt/bitcoin.cpp | 2 +- src/qt/intro.cpp | 2 +- src/rpc/misc.cpp | 2 +- src/rpc/txoutproof.cpp | 2 +- src/test/util_tests.cpp | 2 +- src/txdb.cpp | 2 +- src/wallet/rpcwallet.cpp | 6 +++--- src/wallet/test/wallet_tests.cpp | 2 +- src/wallet/wallet.cpp | 2 +- test/functional/feature_txindex_compatibility.py | 2 +- test/functional/rpc_decodescript.py | 2 +- test/functional/rpc_uptime.py | 2 +- test/functional/wallet_encryption.py | 6 +++--- test/util/test_runner.py | 2 +- 17 files changed, 22 insertions(+), 22 deletions(-) diff --git a/contrib/guix/guix-build b/contrib/guix/guix-build index 1fef7400f5042..122c8dc22df1e 100755 --- a/contrib/guix/guix-build +++ b/contrib/guix/guix-build @@ -194,7 +194,7 @@ fi if ! getent services http https ftp > /dev/null 2>&1; then cat << EOF -ERR: Your system's C library can not find service database entries for at least +ERR: Your system's C library cannot find service database entries for at least one of the following services: http, https, ftp. Hint: Most likely, /etc/services does not exist yet (common for docker images diff --git a/doc/developer-notes.md b/doc/developer-notes.md index 1f3aef04a6839..04013dfcb690e 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -445,7 +445,7 @@ other input. failure, it will throw an exception, which can be caught to recover from the error. - For example, a nullptr dereference or any other logic bug in RPC code - means that the RPC code is faulty and can not be executed. However, the + means that the RPC code is faulty and cannot be executed. However, the logic bug can be shown to the user and the program can continue to run. * `Assume` should be used to document assumptions when program execution can safely continue even if the assumption is violated. In debug builds it @@ -1352,7 +1352,7 @@ A few guidelines for introducing and reviewing new RPC interfaces: - Don't forget to fill in the argument names correctly in the RPC command table. - - *Rationale*: If not, the call can not be used with name-based arguments. + - *Rationale*: If not, the call cannot be used with name-based arguments. - Add every non-string RPC argument `(method, idx, name)` to the table `vRPCConvertParams` in `rpc/client.cpp`. diff --git a/src/net.cpp b/src/net.cpp index 5b07e5f9bfb1f..de9a5f74cca47 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -5189,7 +5189,7 @@ void CaptureMessageToFile(const CAddress& addr, // layer (processing) perspective. auto now = GetTime(); - // Windows folder names can not include a colon + // Windows folder names cannot include a colon std::string clean_addr = addr.ToStringAddrPort(); std::replace(clean_addr.begin(), clean_addr.end(), ':', '_'); diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 41f0fbe804e77..e6e75ae37f19c 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -510,7 +510,7 @@ int GuiMain(int argc, char* argv[]) InitError(strprintf(Untranslated("Error parsing command line arguments: %s\n"), error)); // Create a message box, because the gui has neither been created nor has subscribed to core signals QMessageBox::critical(nullptr, PACKAGE_NAME, - // message can not be translated because translations have not been initialized + // message cannot be translated because translations have not been initialized QString::fromStdString("Error parsing command line arguments: %1.").arg(QString::fromStdString(error))); return EXIT_FAILURE; } diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp index a90535acbc4c0..581ede260433c 100644 --- a/src/qt/intro.cpp +++ b/src/qt/intro.cpp @@ -304,7 +304,7 @@ void Intro::setStatus(int status, const QString &message, quint64 bytesAvailable void Intro::UpdateFreeSpaceLabel() { - QString freeString = tr("%1 GB of free space available").arg(m_bytes_available / GB_BYTES); + QString freeString = tr("%1 GB of space available").arg(m_bytes_available / GB_BYTES); if (m_bytes_available < m_required_space_gb * GB_BYTES) { freeString += " " + tr("(of %1 GB needed)").arg(m_required_space_gb); ui->freeSpace->setStyleSheet(GUIUtil::getThemedStyleQString(GUIUtil::ThemedStyle::TS_ERROR)); diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index a26fa7c5f4265..38f3398d66f3b 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -499,7 +499,7 @@ static RPCHelpMan setmocktime() RPCTypeCheck(request.params, {UniValue::VNUM}); const int64_t time{request.params[0].get_int64()}; if (time < 0) { - throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Mocktime can not be negative: %s.", time)); + throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Mocktime cannot be negative: %s.", time)); } SetMockTime(time); if (auto* node_context = GetContext(request.context)) { diff --git a/src/rpc/txoutproof.cpp b/src/rpc/txoutproof.cpp index 5173e162fd996..a8469485b3857 100644 --- a/src/rpc/txoutproof.cpp +++ b/src/rpc/txoutproof.cpp @@ -133,7 +133,7 @@ static RPCHelpMan verifytxoutproof() RPCResult{ RPCResult::Type::ARR, "", "", { - {RPCResult::Type::STR_HEX, "txid", "The txid(s) which the proof commits to, or empty array if the proof can not be validated."}, + {RPCResult::Type::STR_HEX, "txid", "The txid(s) which the proof commits to, or empty array if the proof cannot be validated."}, } }, RPCExamples{ diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index fbdb851ae19d8..1b9ea354093f5 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -1375,7 +1375,7 @@ BOOST_AUTO_TEST_CASE(util_ParseMoney) BOOST_CHECK_EQUAL(ParseMoney("0.00000001 ").value(), COIN/100000000); BOOST_CHECK_EQUAL(ParseMoney(" 0.00000001").value(), COIN/100000000); - // Parsing amount that can not be represented should fail + // Parsing amount that cannot be represented should fail BOOST_CHECK(!ParseMoney("100000000.00")); BOOST_CHECK(!ParseMoney("0.000000001")); diff --git a/src/txdb.cpp b/src/txdb.cpp index f780b56b44088..90a5a20bba129 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -40,7 +40,7 @@ std::optional CheckLegacyTxindex(CBlockTreeDB& block_tree_db) { CBlockLocator ignored{}; if (block_tree_db.Read(DB_TXINDEX_BLOCK, ignored)) { - return _("The -txindex upgrade started by a previous version can not be completed. Restart with the previous version or run a full -reindex."); + return _("The -txindex upgrade started by a previous version cannot be completed. Restart with the previous version or run a full -reindex."); } bool txindex_legacy_flag{false}; block_tree_db.ReadFlag("txindex", txindex_legacy_flag); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index b4ca6de160730..c79507214d7b9 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2015,7 +2015,7 @@ static RPCHelpMan walletpassphrase() } if (strWalletPass.empty()) { - throw JSONRPCError(RPC_INVALID_PARAMETER, "passphrase can not be empty"); + throw JSONRPCError(RPC_INVALID_PARAMETER, "passphrase cannot be empty"); } if (!pwallet->Unlock(strWalletPass, fForMixingOnly)) { @@ -2087,7 +2087,7 @@ static RPCHelpMan walletpassphrasechange() strNewWalletPass = request.params[1].get_str().c_str(); if (strOldWalletPass.empty() || strNewWalletPass.empty()) { - throw JSONRPCError(RPC_INVALID_PARAMETER, "passphrase can not be empty"); + throw JSONRPCError(RPC_INVALID_PARAMETER, "passphrase cannot be empty"); } if (!pwallet->ChangeWalletPassphrase(strOldWalletPass, strNewWalletPass)) { @@ -2184,7 +2184,7 @@ static RPCHelpMan encryptwallet() strWalletPass = request.params[0].get_str().c_str(); if (strWalletPass.empty()) { - throw JSONRPCError(RPC_INVALID_PARAMETER, "passphrase can not be empty"); + throw JSONRPCError(RPC_INVALID_PARAMETER, "passphrase cannot be empty"); } if (!pwallet->EncryptWallet(strWalletPass)) { diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp index f8b74ee920e57..7fa30ec727d52 100644 --- a/src/wallet/test/wallet_tests.cpp +++ b/src/wallet/test/wallet_tests.cpp @@ -715,7 +715,7 @@ class CreateTransactionTestSetup : public TestChain100Setup const std::string strUnableToLocateCoinJoin1 = "Unable to locate enough non-denominated funds for this transaction."; const std::string strUnableToLocateCoinJoin2 = "Unable to locate enough mixed funds for this transaction. CoinJoin uses exact denominated amounts to send funds, you might simply need to mix some more coins."; const std::string strTransactionTooLarge = "Transaction too large"; - const std::string strChangeIndexOutOfRange = "Change index out of range"; + const std::string strChangeIndexOutOfRange = "Transaction change output index out of range"; const std::string strExceededMaxTries = "Exceeded max tries."; const std::string strMaxFeeExceeded = "Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)"; diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 869af8d63b53a..0d15f415b4c01 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3783,7 +3783,7 @@ bool CWallet::CreateTransactionInternal( } else if ((unsigned int)nChangePosRequest > txNew.vout.size()) { - error = _("Change index out of range"); + error = _("Transaction change output index out of range"); return false; } else { nChangePosInOut = nChangePosRequest; diff --git a/test/functional/feature_txindex_compatibility.py b/test/functional/feature_txindex_compatibility.py index f4a8e7cf55372..ed913f51372ff 100755 --- a/test/functional/feature_txindex_compatibility.py +++ b/test/functional/feature_txindex_compatibility.py @@ -83,7 +83,7 @@ def run_test(self): self.stop_nodes() - self.log.info("Check migrated txindex can not be read by legacy node") + self.log.info("Check migrated txindex cannot be read by legacy node") err_msg = f": You need to rebuild the database using -reindex to change -txindex.{os.linesep}Please restart with -reindex or -reindex-chainstate to recover." shutil.rmtree(legacy_chain_dir) shutil.copytree(migrate_chain_dir, legacy_chain_dir) diff --git a/test/functional/rpc_decodescript.py b/test/functional/rpc_decodescript.py index 438f246af51c5..6df7d1b63ba51 100755 --- a/test/functional/rpc_decodescript.py +++ b/test/functional/rpc_decodescript.py @@ -48,7 +48,7 @@ def decodescript_script_sig(self): rpc_result = self.nodes[0].decodescript('5100') assert_equal('1 0', rpc_result['asm']) - # 5) null data scriptSig - no such thing because null data scripts can not be spent. + # 5) null data scriptSig - no such thing because null data scripts cannot be spent. # thus, no test case for that standard transaction type is here. def decodescript_script_pub_key(self): diff --git a/test/functional/rpc_uptime.py b/test/functional/rpc_uptime.py index 645d76cdfaa90..853c13f13504a 100755 --- a/test/functional/rpc_uptime.py +++ b/test/functional/rpc_uptime.py @@ -23,7 +23,7 @@ def run_test(self): self._test_uptime() def _test_negative_time(self): - assert_raises_rpc_error(-8, "Mocktime can not be negative: -1.", self.nodes[0].setmocktime, -1) + assert_raises_rpc_error(-8, "Mocktime cannot be negative: -1.", self.nodes[0].setmocktime, -1) def _test_uptime(self): wait_time = 10 diff --git a/test/functional/wallet_encryption.py b/test/functional/wallet_encryption.py index 25f19baf8e3c8..126cb9c4f9869 100755 --- a/test/functional/wallet_encryption.py +++ b/test/functional/wallet_encryption.py @@ -35,14 +35,14 @@ def run_test(self): assert_raises_rpc_error(-15, "Error: running with an unencrypted wallet, but walletpassphrasechange was called.", self.nodes[0].walletpassphrasechange, 'ff', 'ff') # Encrypt the wallet - assert_raises_rpc_error(-8, "passphrase can not be empty", self.nodes[0].encryptwallet, '') + assert_raises_rpc_error(-8, "passphrase cannot be empty", self.nodes[0].encryptwallet, '') self.nodes[0].encryptwallet(passphrase) # Test that the wallet is encrypted assert_raises_rpc_error(-13, "Please enter the wallet passphrase with walletpassphrase first", self.nodes[0].signmessage, address, msg) assert_raises_rpc_error(-15, "Error: running with an encrypted wallet, but encryptwallet was called.", self.nodes[0].encryptwallet, 'ff') - assert_raises_rpc_error(-8, "passphrase can not be empty", self.nodes[0].walletpassphrase, '', 1) - assert_raises_rpc_error(-8, "passphrase can not be empty", self.nodes[0].walletpassphrasechange, '', 'ff') + assert_raises_rpc_error(-8, "passphrase cannot be empty", self.nodes[0].walletpassphrase, '', 1) + assert_raises_rpc_error(-8, "passphrase cannot be empty", self.nodes[0].walletpassphrasechange, '', 'ff') # Check that walletpassphrase works self.nodes[0].walletpassphrase(passphrase, 2) diff --git a/test/util/test_runner.py b/test/util/test_runner.py index 1f7c09439dafb..576c2d3de06c2 100755 --- a/test/util/test_runner.py +++ b/test/util/test_runner.py @@ -93,7 +93,7 @@ def bctest(testDir, testObj, buildenv): try: outputData = open(os.path.join(testDir, outputFn), encoding="utf8").read() except: - logging.error("Output file " + outputFn + " can not be opened") + logging.error("Output file " + outputFn + " cannot be opened") raise if not outputData: logging.error("Output data missing for " + outputFn)