Page MenuHomePhabricator

GUI: Refactor formatServicesStr to warn when a ServicesFlag is missing
ClosedPublic

Authored by Fabien on Nov 24 2020, 20:47.

Details

Summary

Backport of core PR17474.

This has been adapted to match our codebase changes from core.
It introduces one change to the way the unknown service bits are displayed,
to make them consistenly display as a bit number. This matches what core does
when the backports are up-to-date and makes the code simpler.

Test Plan
ninja check

./src/qt/bitcoin-qt

Check the service bit display correctly.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien requested review of this revision.Nov 24 2020, 20:47
Fabien planned changes to this revision.Nov 24 2020, 21:16

Make the code closer to code so the later backports are easier to review

deadalnix requested changes to this revision.Nov 25 2020, 03:33
deadalnix added a subscriber: deadalnix.

It seems like you have missing dependencies.

This revision now requires changes to proceed.Nov 25 2020, 03:33

Sorry, I looked at the wrong PR. You need to explain or fix as per inline comments.

src/qt/guiutil.cpp
768 ↗(On Diff #26011)

You can decommission this one.

772 ↗(On Diff #26011)

It returns a different string based on bit.

src/qt/guiutil.cpp
768 ↗(On Diff #26011)

Done in D8524.

772 ↗(On Diff #26011)

I thought I edited the summary but apparently not, I will fix that.

Rather than displaying differently according to the bit value, I simplified it and always display the bit number. This makes the code simpler and the UNKNOWN service flags easier to read.
This is a "shortcut" to what core is currently doing, so when this code part is in sync the behavior will be the same and cause no conflict.

deadalnix requested changes to this revision.Nov 25 2020, 16:21
deadalnix added inline comments.
src/qt/guiutil.cpp
772 ↗(On Diff #26011)

So why not follow the same path? You'll get the same result without confusing anyone along the way, today, or in the future.

This revision now requires changes to proceed.Nov 25 2020, 16:21

Backport the whole conditional display rendering

This revision is now accepted and ready to land.Nov 25 2020, 16:38
This revision was landed with ongoing or failed builds.Nov 25 2020, 16:43
This revision was automatically updated to reflect the committed changes.