ElementsProject / rust-elements

Rust support for Elements transaction/block deserialization
Creative Commons Zero v1.0 Universal
52 stars 33 forks source link

Introduce Sequence and LockTime from rust-bitcoin #152

Closed apoelstra closed 2 years ago

apoelstra commented 2 years ago

The PSET stuff I'm a little uncertain about -- PSBT2 brings new locktime logic in that doesn't exist in PSBT0. My new logic is essentially the same, except that while previously we would allow the user to specify invalid locktimes (since we just parsed a u32 with no further checking) now we don't.

I think, when we do this upstream in rust-bitcoin, we should probably introduce some helper methods into LockTime, because currently there are conversions from Time/Height into LockTime that feel misplaced.

Also, it is really unclear what the difference between LockTime and PackedLockTime is supposed to be, so I did my best to copy rust-bitcoin.

apoelstra commented 2 years ago

Added a couple commits which copy more code in from rust-bitcoin.