Currently FundTransaction
handles transaction locktime and preset input data by extracting the selected inputs and change output from CreateTransaction
’s results. This means that CreateTransaction
is actually unaware of any user desired locktime or sequence numbers. This can have an effect on whether and how anti-fee-sniping works.
This PR makes CreateTransaction
aware of the locktime and preset input data by providing them to CCoinControl
. CreateTransasction
will then set the sequences, scriptSigs, scriptWItnesses, and locktime as appropriate if they are specified. This allows FundTransaction
to actually use CreateTransaction
’s result directly instead of having to extract the parts of it that it wants.
Additionally FundTransaction
will return a CreateTransactionResult
as CreateTransaction
does instead of having several output parameters. Lastly, instead of using -1
as a magic number for the change output position, the change position is changed to be an optional with no value set indicating no desired change output position (when provided as an input parameter) or no change output present (in the result).