HomePhabricator

util: simplify the interface of serviceFlagToStr()

Description

util: simplify the interface of serviceFlagToStr()

Summary:

Don't take two redundant arguments in `serviceFlagToStr()`.

As a side effect this fixes an issue introduced in
https://github.com/bitcoin/bitcoin/pull/18165 due to which the GUI could
print something like `UNKNOWN[1033] & UNKNOWN[1033] & UNKNOWN[2^10]`
instead of `NETWORK & WITNESS`.

util: dedup code in callers of serviceFlagToStr()

Backport of core PR19106.

Depends on D8518.

Test Plan:

ninja all check-all

./src/qt/bitcoin-qt -server

Check the service bits display correctly

./src/bitcoin-cli getnetworkinfo

Check the service bits display correctly

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

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

Details

Provenance
Vasil Dimov <vd@FreeBSD.org>Authored on May 29 2020, 16:49
FabienCommitted on Nov 25 2020, 16:43
FabienPushed on Nov 25 2020, 16:44
Reviewer
Restricted Project
Differential Revision
D8519: util: simplify the interface of serviceFlagToStr()
Parents
rABC81a1f3236ee4: Consolidate service flag bit-to-name conversion to a shared serviceFlagToStr…
Branches
Unknown
Tags
Unknown

Event Timeline