refactor: Add CWallet:::AttachChain method
Summary:
This commit does not change behavior, it just moves code from
CWallet::CreateWalletFromFile to CWallet:::AttachChain so it can be updated in
the next commit.
This commit is most easily reviewed with
"git diff -w --color-moved=dimmed_zebra" or by diffing CWallet:::AttachChain
against the previous code with an external diff tool.
This is a partial backport of core#20773
https://github.com/bitcoin/bitcoin/pull/20773/commits/44c430ffac940e1d1dd7f5939a495470bc694489
Depends on D17642
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, roqqit
Reviewed By: #bitcoin_abc, roqqit
Subscribers: roqqit
Differential Revision: https://reviews.bitcoinabc.org/D17643