Consolidate service flag bit-to-name conversion to a shared serviceFlagToStr function
Summary:
Side effect: this results in the RPC showing unknown service bits as "UNKNOWN[n]" like the GUI. Note that there is no common mask-to-vector<string> function because both GUI and RPC would need to iterate through it to convert to their desired target formats.
Backport of core PR18165.
Depends on D8516.
Test Plan:
ninja all check-all ./src/qt/bitcoin-qt -server
Check the service bits are displayed correctly in the peers window
./src/bitcoin-cli getnetworkinfo
Check the service bits are displayed correctly
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Subscribers: deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D8518