]> Untitled Git - bdk/commit
[wallet] Take both spending policies into account in create_tx
authorAlekos Filini <alekos.filini@gmail.com>
Tue, 10 Nov 2020 14:06:14 +0000 (15:06 +0100)
committerAlekos Filini <alekos.filini@gmail.com>
Fri, 13 Nov 2020 11:55:42 +0000 (12:55 +0100)
commit7c80aec4542af285b4f281622c7d0dbe6d39c934
tree1d921d58ddf996d389bdc01b4f2fc3345fa0d5e5
parent9f31ad1bc8acdb90385e4b8f29423242da3766ef
[wallet] Take both spending policies into account in create_tx

This allows specifying different "policy paths" for the internal and external
descriptors, and adds additional checks to make sure they are compatibile (i.e.
the timelocks are expressed in the same unit).

It's still suboptimal, since the `n_sequence`s are per-input and not per-transaction,
so it should be possibile to spend different inputs with different, otherwise
incompatible, `CSV` timelocks, but that requires a larger refactor that
can be done in a future patch.

This commit also tries to clarify how the "policy path" should be used by adding
a fairly detailed example to the docs.
src/descriptor/policy.rs
src/error.rs
src/wallet/mod.rs
src/wallet/tx_builder.rs