Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ in order.
### Cache

In order to avoid rebuilding all dependencies for each build, the binaries are
cached and re-used when possible. Changes in the dependency-generator will
cached and reused when possible. Changes in the dependency-generator will
trigger cache-invalidation and rebuilds as necessary.
2 changes: 1 addition & 1 deletion depends/description.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ etc), and as well as a hash of the same data for each recursive dependency. If
any portion of a package's build recipe changes, it will be rebuilt as well as
any other package that depends on it. If any of the main makefiles (Makefile,
funcs.mk, etc) are changed, all packages will be rebuilt. After building, the
results are cached into a tarball that can be re-used and distributed.
results are cached into a tarball that can be reused and distributed.

### Package build results are (relatively) deterministic.

Expand Down
4 changes: 2 additions & 2 deletions src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2917,7 +2917,7 @@ void PeerManagerImpl::ProcessGetData(CNode& pfrom, Peer& peer, const std::atomic
// of transactions relevant to them, without having to download the
// entire memory pool.
// Also, other nodes can use these messages to automatically request a
// transaction from some other peer that annnounced it, and stop
// transaction from some other peer that announced it, and stop
// waiting for us to respond.
// In normal operation, we often send NOTFOUND messages for parents of
// transactions that we relay; if a peer is missing a parent, they may
Expand Down Expand Up @@ -3789,7 +3789,7 @@ void PeerManagerImpl::ProcessMessage(
return;
}

// Log succesful connections unconditionally for outbound, but not for inbound as those
// Log successful connections unconditionally for outbound, but not for inbound as those
// can be triggered by an attacker at high rate.
if (!pfrom.IsInboundConn() || LogAcceptCategory(BCLog::NET, BCLog::Level::Debug)) {
LogPrintf("New %s %s peer connected: version: %d, blocks=%d, peer=%d%s\n",
Expand Down
2 changes: 1 addition & 1 deletion src/qt/transactiontablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class TransactionTablePriv

// If a status update is needed (blocks came in since last check),
// try to update the status of this transaction from the wallet.
// Otherwise, simply re-use the cached status.
// Otherwise, simply reuse the cached status.
interfaces::WalletTxStatus wtx;
int numBlocks;
int64_t block_time;
Expand Down
8 changes: 7 additions & 1 deletion src/rpc/request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ static fs::path GetAuthCookieFile(bool temp=false)
return AbsPathForConfigVal(arg);
}

static bool g_generated_cookie = false;

bool GenerateAuthCookie(std::string *cookie_out)
{
const size_t COOKIE_SIZE = 32;
Expand All @@ -103,6 +105,7 @@ bool GenerateAuthCookie(std::string *cookie_out)
LogPrintf("Unable to rename cookie authentication file %s to %s\n", fs::PathToString(filepath_tmp), fs::PathToString(filepath));
return false;
}
g_generated_cookie = true;
LogPrintf("Generated RPC authentication cookie %s\n", fs::PathToString(filepath));

if (cookie_out)
Expand All @@ -129,7 +132,10 @@ bool GetAuthCookie(std::string *cookie_out)
void DeleteAuthCookie()
{
try {
fs::remove(GetAuthCookieFile());
if (g_generated_cookie) {
// Delete the cookie file if it was generated by this process
fs::remove(GetAuthCookieFile());
}
} catch (const fs::filesystem_error& e) {
LogPrintf("%s: Unable to remove random auth cookie file: %s\n", __func__, fsbridge::get_filesystem_error_message(e));
}
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ static inline JSONRPCRequest transformNamedArguments(const JSONRPCRequest& in, c
}
// Process expected parameters. If any parameters were left unspecified in
// the request before a parameter that was specified, null values need to be
// inserted at the unspecifed parameter positions, and the "hole" variable
// inserted at the unspecified parameter positions, and the "hole" variable
// below tracks the number of null values that need to be inserted.
// The "initial_hole_size" variable stores the size of the initial hole,
// i.e. how many initial positional arguments were left unspecified. This is
Expand Down
2 changes: 1 addition & 1 deletion src/test/fuzz/FuzzedDataProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ FuzzedDataProvider::ConsumeRandomLengthString(size_t max_length) {
// picking its contents.
std::string result;

// Reserve the anticipated capaticity to prevent several reallocations.
// Reserve the anticipated capacity to prevent several reallocations.
result.reserve(std::min(max_length, remaining_bytes_));
for (size_t i = 0; i < max_length && remaining_bytes_ != 0; ++i) {
char next = ConvertUnsignedToSigned<char>(data_ptr_[0]);
Expand Down
2 changes: 1 addition & 1 deletion src/test/orphanage_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ BOOST_AUTO_TEST_CASE(DoS_mapOrphans)
tx.vin[j].prevout.hash = txPrev->GetHash();
}
BOOST_CHECK(SignSignature(keystore, *txPrev, tx, 0, SIGHASH_ALL));
// Re-use same signature for other inputs
// Reuse same signature for other inputs
// (they don't have to be valid for this test)
for (unsigned int j = 1; j < tx.vin.size(); j++)
tx.vin[j].scriptSig = tx.vin[0].scriptSig;
Expand Down
2 changes: 1 addition & 1 deletion src/test/script_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG23)
BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));

keys.clear();
keys.push_back(key2); keys.push_back(key2); // Can't re-use sig
keys.push_back(key2); keys.push_back(key2); // Can't reuse sig
CScript badsig1 = sign_multisig(scriptPubKey23, keys, CTransaction(txTo23));
BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey23, gFlags, MutableTransactionSignatureChecker(&txTo23, 0, txFrom23.vout[0].nValue, MissingDataBehavior::ASSERT_FAIL), &err));
BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err));
Expand Down
2 changes: 1 addition & 1 deletion src/test/versionbits_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ BOOST_AUTO_TEST_CASE(versionbits_computeblockversion)
uint32_t chain_all_vbits{0};
for (int i = 0; i < (int)Consensus::MAX_VERSION_BITS_DEPLOYMENTS; ++i) {
const auto dep = static_cast<Consensus::DeploymentPos>(i);
// Check that no bits are re-used (within the same chain). This is
// Check that no bits are reused (within the same chain). This is
// disallowed because the transition to FAILED (on timeout) does
// not take precedence over STARTED/LOCKED_IN. So all softforks on
// the same bit might overlap, even when non-overlapping start-end
Expand Down
2 changes: 1 addition & 1 deletion src/torcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ std::map<std::string,std::string> ParseTorReplyMapping(const std::string &s)
/**
* Unescape value. Per https://spec.torproject.org/control-spec section 2.1.1:
*
* For future-proofing, controller implementors MAY use the following
* For future-proofing, controller implementers MAY use the following
* rules to be compatible with buggy Tor implementations and with
* future ones that implement the spec as intended:
*
Expand Down
2 changes: 1 addition & 1 deletion src/txmempool.h
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ class CTxMemPool
void removeRecursive(const CTransaction& tx, MemPoolRemovalReason reason) EXCLUSIVE_LOCKS_REQUIRED(cs);
/** After reorg, filter the entries that would no longer be valid in the next block, and update
* the entries' cached LockPoints if needed. The mempool does not have any knowledge of
* consensus rules. It just appplies the callable function and removes the ones for which it
* consensus rules. It just applies the callable function and removes the ones for which it
* returns true.
* @param[in] filter_final_and_mature Predicate that checks the relevant validation rules
* and updates an entry's LockPoints.
Expand Down
6 changes: 0 additions & 6 deletions src/wallet/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ void WalletInit::AddWalletOptions(ArgsManager& argsman) const

argsman.AddArg("-walletrejectlongchains", strprintf("Wallet will not create transactions that violate mempool chain limits (default: %u)", DEFAULT_WALLET_REJECT_LONG_CHAINS), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::WALLET_DEBUG_TEST);
argsman.AddArg("-walletcrosschain", strprintf("Allow reusing wallet files across chains (default: %u)", DEFAULT_WALLETCROSSCHAIN), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::WALLET_DEBUG_TEST);

argsman.AddHiddenArgs({"-zapwallettxes"});
}

bool WalletInit::ParameterInteraction() const
Expand All @@ -147,10 +145,6 @@ bool WalletInit::ParameterInteraction() const
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0\n", __func__);
}

if (gArgs.IsArgSet("-zapwallettxes")) {
return InitError(Untranslated("-zapwallettxes has been removed. If you are attempting to remove a stuck transaction from your wallet, please use abandontransaction instead."));
}

int rescan_mode = gArgs.GetIntArg("-rescan", 0);
if (rescan_mode < 0 || rescan_mode > 2) {
LogPrintf("%s: Warning: incorrect -rescan mode, falling back to default value.\n", __func__);
Expand Down
4 changes: 2 additions & 2 deletions src/wallet/spend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ static util::Result<CreatedTransactionResult> CreateTransactionInternal(
}

// Before we return success, we assume any change key will be used to prevent
// accidental re-use.
// accidental reuse.
reservedest.KeepDestination();

wallet.WalletLogPrintf("Fee Calculation: Fee:%d Bytes:%u Tgt:%d (requested %d) Reason:\"%s\" Decay %.5f: Estimation: (%g - %g) %.2f%% %.1f/(%.1f %d mem %.1f out) Fail: (%g - %g) %.2f%% %.1f/(%.1f %d mem %.1f out)\n",
Expand Down Expand Up @@ -1111,7 +1111,7 @@ util::Result<CreatedTransactionResult> CreateTransaction(
CCoinControl tmp_cc = coin_control;
tmp_cc.m_avoid_partial_spends = true;

// Re-use the change destination from the first creation attempt to avoid skipping BIP44 indexes
// Reuse the change destination from the first creation attempt to avoid skipping BIP44 indexes
const int ungrouped_change_pos = txr_ungrouped.change_pos;
if (ungrouped_change_pos != -1) {
ExtractDestination(txr_ungrouped.tx->vout[ungrouped_change_pos].scriptPubKey, tmp_cc.destChange);
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ extern const std::map<uint64_t,std::string> WALLET_FLAG_CAVEATS;
* Instantiating a ReserveDestination does not reserve an address. To do so,
* GetReservedDestination() needs to be called on the object. Once an address has been
* reserved, call KeepDestination() on the ReserveDestination object to make sure it is not
* returned. Call ReturnDestination() to return the address so it can be re-used (for
* returned. Call ReturnDestination() to return the address so it can be reused (for
* example, if the address was used in a new transaction
* and that transaction was not completed and needed to be aborted).
*
Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_filelock.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ def run_test(self):
expected_msg = f"Error: Cannot obtain a lock on data directory {datadir}. {self.config['environment']['PACKAGE_NAME']} is probably already running."
self.nodes[1].assert_start_raises_init_error(extra_args=[f'-datadir={self.nodes[0].datadir}', '-noserver'], expected_msg=expected_msg)

cookie_file = datadir / ".cookie"
assert cookie_file.exists() # should not be deleted during the second bitcoind instance shutdown

if self.is_wallet_compiled():
def check_wallet_filelock(descriptors):
wallet_name = ''.join([random.choice(string.ascii_lowercase) for _ in range(6)])
Expand Down
2 changes: 1 addition & 1 deletion test/functional/test_framework/blockfilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def bip158_basic_element_hash(script_pub_key, N, block_hash):


def bip158_relevant_scriptpubkeys(node, block_hash):
""" Determines the basic filter relvant scriptPubKeys as defined in BIP158:
""" Determines the basic filter relevant scriptPubKeys as defined in BIP158:

'A basic filter MUST contain exactly the following items for each transaction in a block:
- The previous output script (the script being spent) for each input, except for
Expand Down
2 changes: 1 addition & 1 deletion test/lint/check-doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
CMD_GREP_WALLET_HIDDEN_ARGS = r"git grep --function-context 'void DummyWalletInit::AddWalletOptions' -- {}".format(CMD_ROOT_DIR)
CMD_GREP_DOCS = r"git grep --perl-regexp '{}' {}".format(REGEX_DOC, CMD_ROOT_DIR)
# list unsupported, deprecated and duplicate args as they need no documentation
SET_DOC_OPTIONAL = set(['-h', '-help', '-dbcrashratio', '-forcecompactdb', '-zapwallettxes'])
SET_DOC_OPTIONAL = set(['-h', '-help', '-dbcrashratio', '-forcecompactdb'])


def lint_missing_argument_documentation():
Expand Down
1 change: 1 addition & 0 deletions test/lint/spelling.ignore-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ blockin
cachable
creat
crypted
debbugs
fo
fpr
hights
Expand Down
Loading