Skip to content

wallet: Use PACKAGE_NAME to mention our software - #23311

Merged
maflcko merged 1 commit into
bitcoin:masterfrom
hebasto:211019-name
Oct 25, 2021
Merged

maflcko merged 1 commit into
bitcoin:masterfrom
hebasto:211019-name

Conversation

@hebasto

@hebasto hebasto commented Oct 19, 2021

Copy link
Copy Markdown
Member

This PR replaces "bitcoin" and "bitcoind" with PACKAGE_NAME in wallet log and error messages.

Comment thread src/wallet/bdb.cpp Resolved

@shaavan shaavan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK

This change helps in the generalization of strings and makes them robust in case of any possible future change.

I was just curious. What do you think about adding the word “instance” followed by the package name?

For example:

throw std::runtime_error("SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another " PACKAGE_NAME "?\n");

Changed to

throw std::runtime_error("SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another " PACKAGE_NAME " instance?\n");

This suggestion is valid for all the strings that have been updated except the one in the src/wallet/bdb.cpp file

@laanwj

laanwj commented Oct 20, 2021

Copy link
Copy Markdown
Member

Concept ACK

I was just curious. What do you think about adding the word “instance” followed by the package name?

Yes, I think adding "instance" makes the sentences better.

@jarolrod

Copy link
Copy Markdown
Contributor

concept ACK

Comment thread src/wallet/sqlite.cpp Resolved
@hebasto

hebasto commented Oct 20, 2021

Copy link
Copy Markdown
Member Author

Updated 16fad5b -> da791c7 (pr23311.01 -> pr23311.02, diff).

Thanks to all reviewers, your comments are addressed 🐅

@lsilva01 lsilva01 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK da791c7 on Ubuntu 20.04.

@jonatack

Copy link
Copy Markdown
Member

ACK da791c7

Verified that changing the test assertions to just "Bitcoin Core" is equivalent.

Would it make sense to also update these 3 lines?

src/wallet/dump.cpp:147:        error = strprintf(_("Error: Dumpfile version is not supported. This version of bitcoin-wallet only supports version 1 dumpfiles. Got dumpfile with version %s"), version_value);
test/functional/tool_wallet.py:362:        self.assert_raises_tool_error('Error: Dumpfile version is not supported. This version of bitcoin-wallet only supports version 1 dumpfiles. Got dumpfile with version 0', '-wallet=badload', '-dumpfile={}'.format(bad_ver_wallet_dump), 'createfromdump')
test/functional/tool_wallet.py:367:        self.assert_raises_tool_error('Error: Dumpfile version is not supported. This version of bitcoin-wallet only supports version 1 dumpfiles. Got dumpfile with version 2', '-wallet=badload', '-dumpfile={}'.format(bad_ver_wallet_dump), 'createfromdump')

@brunoerg brunoerg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK da791c7

@stratospher stratospher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK da791c7

The generic error messages introduced by this PR in src/wallet/bdb.cpp and src/wallet/sqlite.cpp, which reflect that there may be other instances(not necessarily a bitcoin instance or a bitcoind instance) using the lock is a nice change!

@shaavan shaavan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK da791c7

Changes since my last review:

  1. Removed “of bitcoin” in the string in the src/wallet/bdb.cpp file to increase the generality of this string message.
  2. Added “instance of” in all other (updated) strings to correct the sentences.

@maflcko

maflcko commented Oct 25, 2021

Copy link
Copy Markdown
Member

I still think we can remove PACKAGE_NAME, because it is not possible to say whether the other instance is Bitcoin Core or Bitcoin Knots, or bitcoind, or bitcoin-qt, or ...

But 🤷

@maflcko
maflcko merged commit beb45b8 into bitcoin:master Oct 25, 2021
@hebasto
hebasto deleted the 211019-name branch October 25, 2021 17:10
@bitcoin bitcoin locked and limited conversation to collaborators Oct 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.