Methods often take a reference to a K or an owned K. They often return a reference or sometimes an owned K. I think we should always just used owned. Also I think we should owned ScriptBuf's rather than Script. The reason is they are both usually small and fine to copy:
K is usually small and needs to be anyway if you derive lots of spks from a keychain (it is copied each time you do that into the underlying SpkTxOutIndex.
- script pubkeys are usually small unless you are doing stuff like DoSing the mempool/utxo set which we don't need to support.
It should be owned everywhere and this should be brought up to the Wallet API.
Methods often take a reference to a
Kor an ownedK. They often return a reference or sometimes an ownedK. I think we should always just used owned. Also I think we should ownedScriptBuf's rather thanScript. The reason is they are both usually small and fine to copy:Kis usually small and needs to be anyway if you derive lots of spks from a keychain (it is copied each time you do that into the underlyingSpkTxOutIndex.It should be owned everywhere and this should be brought up to the
WalletAPI.