Support watchonly in fundrawtransaction, CreateTransaction, SelectCoins and coin selection in general.
Coin selection is exposed over RPC through fundrawtransaction, and watchonly can be enabled by passing includeWatching true (defaults to false).
fundrawtransaction will first attempt to fund a transaction without using watchonly, even when includeWatching is enabled. When this fails, an includeWatching attempt is made.
When an includeWatching attempt at coin selection is performed (in CreateTransaction), and all watchonlys are consumed leaving no funds available for a fee, then CreateTransaction will not include a fee in the transaction.
Also, includeWatching tests (for fundrawtransaction) added here are passing.
Reviewers! Here are some things I would especially appreciate eyelooking for: suggestions for more edge cases for the tests, other RPC commands that should be tested, other tests for other features that I should double check for whether or not this makes any impacts, locations or existence of any sort of documentation I should be updating, unintended side effects introduced in CreateTransaction like by multiple parameters that may eventually be used simultaneously in ways that I am failing to anticipate….
I received a few suggestions from others that SignSignature should be replaced with an estimator in CreateTransaction. However, this estimator apparently does not seem to be necessary for implementing watchonly-support here, so this suggestion may go into another ticket instead.
This requires #5503 to be merged (I wouldn’t mind this getting merged into #5503).