[backport#17304 11/18] Refactor: Move GetMetadata code out of getaddressinfo
Summary:
Easier to review ignoring whitespace:
git log -p -n1 -w
This commit does not change behavior.
https://github.com/bitcoin/bitcoin/pull/17304/commits/a18edd7b383d667b15b6d4b87aa3a055a9fa5051
Depends on D7157
Partial backport of Core PR17304
Test Plan:
ninja check
Reviewers: #bitcoin_abc, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D7158