-
Notifications
You must be signed in to change notification settings - Fork 421
Description
Currently the defacto way to handle a spendable outputs event is to call spend_spendable_outputs from the KeysManager. If you have multiple nodes you cannot batch these transactions together without having to reimplement all of spend_spendable_outputs which is pretty complex (and I'm not even sure if everything is exposed).
This could be easily solved if instead it was refactored to instead have two functions that spend_spendable_outputs could call. First being something like create_spendable_outputs_psbt that would create a PSBT from a list of spendable outputs for a keymanager, ideally this isn't just an empty PSBT but adds in the witness utxos, witness scripts, etc. Then second being sign_spendable_outputs_psbt which would take in a psbt and list of spendable outputs and sign and finalize any inputs it could.
With these it would open up a lot more ways to handle the spendable outputs, like adding in extra inputs or batching between different keymanagers.