As discussed in #11289 (comment), adds the CScripts from the wallet to the dumpwallet RPC and then allows them to be imported with the importwallet RPC. Includes a basic test, and modifies the helptext of the dumpwallet RPC.
Notes:
- Reviewers: use
?w=1to avoid the indentation-only change in commitAdd scripts to importwallet RPC - currently the scripts are followed with
# addr=comments just as the other keys are, unsure if this might confuse users into thinking all the scripts are for valid P2SH addresses though, but I don't think that should be an issue. - there are no birthtimes for scripts, so script imports don't affect rescans
importwalletimports the CScripts but I'm not sure how to approach specifying whether scripts are for P2SH addresses, BIP173 addresses, etc. whether that matters or not. Otherwise the RPC helptext might just need modification.
Fixes #11715