Implement GetSolvingProvider for DescriptorScriptPubKeyMan
Summary:
Internally, a GetSigningProvider function is introduced which allows for
some private keys to be optionally included. This can be called with a
script as the argument (i.e. a scriptPubKey from our wallet when we are
signing) or with a pubkey. In order to know what index to expand the
private keys for that pubkey, we need to also cache all of the pubkeys
involved when we expand the descriptor. So SetCache and TopUp are
updated to do this too.
Backport of Core PR16528 [27/43] : https://github.com/bitcoin/bitcoin/pull/16528/commits/d50c8ddd4190f20bf0debd410348b73408ec3143
Test Plan:
ninja all check-all
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Differential Revision: https://reviews.bitcoinabc.org/D8446