HomePhabricator

util: change GetWarnings parameter to bool

Description

util: change GetWarnings parameter to bool

Summary:

GetWarnings() changes the format of the output warning string based on a
passed-in string argument that can be set to "gui" or "statusbar".
Change the argument to a bool verbose:

  • there are only two types of behaviour, so a bool is a more natural

argument type

  • changing the name to 'verbose' does not set any expectations for the

how the calling code will use the returned string (currently,
'statusbar' is used for RPC warnings, not a status bar)

  • removes some error-handling code for when the passed-in string is not

one of the two strings expected.

This is a partial backport of Core PR17750 [2/3]
https://github.com/bitcoin/bitcoin/pull/17750/commits/492c6dc1e742a62599dc6d5ba6c3896825b5144f

Depends on D8329

Test Plan:
ninja && src/qt/bitcoin-qt -regtest

The warning banner "This is a pre-release test build..." uses getWarnings().

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D8330

Details

Provenance
John Newbery <john@johnnewbery.com>Authored on Nov 9 2020, 17:40
PiRKCommitted on Nov 9 2020, 17:40
abc-botPushed on Nov 9 2020, 17:46
Reviewer
Restricted Project
Differential Revision
D8330: util: change GetWarnings parameter to bool
Parents
rABCbe4866e55d9d: use preferred shebang approach for documentation
Branches
Unknown
Tags
Unknown