Use func macro in std::runtime_exception to:
- fix method name in CWalletTx::GetAvailableWatchOnlyCredit()
- refactor CWalletTx::GetAvailableCredit()
Use func macro in std::runtime_exception to:
Use __func__ macro in std::runtime_exception to:
1. fix method name in CWalletTx::GetAvailableWatchOnlyCredit()
2. refactor CWalletTx::GetAvailableCredit()
Other places do this, but it frustrates grepping the source code.
If you do so, maybe also tackle the LogPrintf's and get rid of static "CWalletXX::" there?
it frustrates grepping the source code
At first glance your comment seems reasonable, but is it really a problem? Why not just grep for the function name? Blindly grepping for the complete log string is already going to fail for those log messages that contain C string format specifiers.
Using __func__ is preferred because it means one less thing that can be forgotten to be updated when moving the code around to another function.
This guarantees that the message will actually have been emitted in the function that is mentioned in the message.
As for grepping the message, you could search either the function itself, then locate it manually, or for part of the message that follows the function name. This is already the case as __func__ is used almost everywhere, it's not a discussion worth having IMO.
utACK https://github.com/bitcoin/bitcoin/pull/10744/commits/9bbf60047ea3300ebaffbe8cdc7c71e984418c20
utACK 9bbf60047ea3300ebaffbe8cdc7c71e984418c20