pczt: Add pay_manual command.#136
Conversation
ccf6582 to
d2df284
Compare
| // TODO: we should return an error if any of the UTXOs being spent are outputs of a | ||
| // coinbase transaction and the change address is transparent-only; however, we do not have | ||
| // the information necessary to make such a determination about the inputs here; we don't | ||
| // get that information from the RawTransaction data returned from the light client server. |
There was a problem hiding this comment.
Yes we do. Once we have raw_tx resolved from the coin's prevout, we can determine whether it is a coinbase transaction via bundle.is_coinbase().
What we should do is augment the Coin helper JSON so that if the caller provides a transparent change_address, we can require them to specify an is_coinbase: Option<bool> field if they provided value and script_pubkey (i.e. in the current situation where a remote lookup would not be performed).
There was a problem hiding this comment.
I don't understand the second paragraph here. When spending a coinbase output, we still have to perform a lookup of that output in order to get the txout; what is the is_coinbase field you're suggesting supposed to be used for?
There was a problem hiding this comment.
What I mean is, if the caller has provided the txout data in their JSON (i.e. the Coin.value and Coin.script_pubkey optional fields), they should also be required to say if the coin is coinbase or not if the change address is transparent such that it matters (as otherwise there was no point in providing those two fields, as it wouldn't avoid the lookup).
d2df284 to
eb015d9
Compare
This builds atop #134 and depends upon zcash/librustzcash#2094
Fixes #102