Skip to content

Commit beb45b8

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#23311: wallet: Use PACKAGE_NAME to mention our software
da791c7 wallet: Use PACKAGE_NAME to mention our software (Hennadii Stepanov) Pull request description: This PR replaces "bitcoin" and "bitcoind" with `PACKAGE_NAME` in wallet log and error messages. ACKs for top commit: jonatack: ACK da791c7 lsilva01: Tested ACK da791c7 on Ubuntu 20.04. brunoerg: tACK da791c7 stratospher: Tested ACK da791c7 shaavan: ACK da791c7 Tree-SHA512: c613446d9c8c3f85e6f5fec77382c9bc17746a853c89e72e1a3a79bf355d7bd9e455bbde8f9e02a894d225a67029c732cdc68ec8c58ac8237dde27d39dae8be7
2 parents 1847ce2 + da791c7 commit beb45b8

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/wallet/bdb.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ bool BerkeleyEnvironment::Open(bilingual_str& err)
132132
fs::path pathIn = fs::PathFromString(strPath);
133133
TryCreateDirectories(pathIn);
134134
if (!LockDirectory(pathIn, ".walletlock")) {
135-
LogPrintf("Cannot obtain a lock on wallet directory %s. Another instance of bitcoin may be using it.\n", strPath);
135+
LogPrintf("Cannot obtain a lock on wallet directory %s. Another instance may be using it.\n", strPath);
136136
err = strprintf(_("Error initializing wallet database environment %s!"), fs::quoted(fs::PathToString(Directory())));
137137
return false;
138138
}

src/wallet/sqlite.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ void SQLiteDatabase::Open()
228228
// Now begin a transaction to acquire the exclusive lock. This lock won't be released until we close because of the exclusive locking mode.
229229
int ret = sqlite3_exec(m_db, "BEGIN EXCLUSIVE TRANSACTION", nullptr, nullptr, nullptr);
230230
if (ret != SQLITE_OK) {
231-
throw std::runtime_error("SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another bitcoind?\n");
231+
throw std::runtime_error("SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of " PACKAGE_NAME "?\n");
232232
}
233233
ret = sqlite3_exec(m_db, "COMMIT", nullptr, nullptr, nullptr);
234234
if (ret != SQLITE_OK) {

test/functional/feature_filelock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def check_wallet_filelock(descriptors):
3535
wallet_dir = os.path.join(datadir, 'wallets')
3636
self.log.info("Check that we can't start a second bitcoind instance using the same wallet")
3737
if descriptors:
38-
expected_msg = "Error: SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another bitcoind?"
38+
expected_msg = f"Error: SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of {self.config['environment']['PACKAGE_NAME']}?"
3939
else:
4040
expected_msg = "Error: Error initializing wallet database environment"
4141
self.nodes[1].assert_start_raises_init_error(extra_args=[f'-walletdir={wallet_dir}', f'-wallet={wallet_name}', '-noserver'], expected_msg=expected_msg, match=ErrorMatch.PARTIAL_REGEX)

test/functional/tool_wallet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def test_invalid_tool_commands_and_args(self):
193193
locked_dir = os.path.join(self.options.tmpdir, "node0", "regtest", "wallets")
194194
error = 'Error initializing wallet database environment "{}"!'.format(locked_dir)
195195
if self.options.descriptors:
196-
error = "SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another bitcoind?"
196+
error = f"SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of {self.config['environment']['PACKAGE_NAME']}?"
197197
self.assert_raises_tool_error(
198198
error,
199199
'-wallet=' + self.default_wallet_name,

test/functional/wallet_multiwallet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def wallet_file(name):
202202
self.restart_node(0, ['-nowallet', '-walletdir=' + competing_wallet_dir])
203203
self.nodes[0].createwallet(self.default_wallet_name)
204204
if self.options.descriptors:
205-
exp_stderr = r"Error: SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another bitcoind?"
205+
exp_stderr = f"Error: SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of {self.config['environment']['PACKAGE_NAME']}?"
206206
else:
207207
exp_stderr = r"Error: Error initializing wallet database environment \"\S+competing_walletdir\S*\"!"
208208
self.nodes[1].assert_start_raises_init_error(['-walletdir=' + competing_wallet_dir], exp_stderr, match=ErrorMatch.PARTIAL_REGEX)
@@ -303,7 +303,7 @@ def wallet_file(name):
303303
# Fail to load duplicate wallets
304304
path = os.path.join(self.options.tmpdir, "node0", "regtest", "wallets", "w1", "wallet.dat")
305305
if self.options.descriptors:
306-
assert_raises_rpc_error(-4, "Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another bitcoind?", self.nodes[0].loadwallet, wallet_names[0])
306+
assert_raises_rpc_error(-4, f"Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of {self.config['environment']['PACKAGE_NAME']}?", self.nodes[0].loadwallet, wallet_names[0])
307307
else:
308308
assert_raises_rpc_error(-35, "Wallet file verification failed. Refusing to load database. Data file '{}' is already loaded.".format(path), self.nodes[0].loadwallet, wallet_names[0])
309309

0 commit comments

Comments
 (0)