[backport#17261 10/13] Box the wallet: Add multiple keyman maps and loops
Summary:
Add wallet logic for dealing with multiple ScriptPubKeyMan instances. This
doesn't change current behavior because there is still only a single
LegacyScriptPubKeyMan. But in the future the new logic will be used to support
descriptor wallets.
https://github.com/bitcoin/bitcoin/pull/17261/commits/c729afd0a3b74a3943e4c359270beaf3e6ff8a7b
Note: Had to bring in PR18052 to fix an instance of -Wmaybe-uninitialized
Depends on D7858
Partial backport of Core PR17261 and PR18052
Test Plan:
ninja all check check-functional
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Subscribers: deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D7859