bitcoinerlab / descriptors

A TypeScript library for parsing Bitcoin Descriptors, including Miniscript-based ones. Streamlines creating Partially Signed Bitcoin Transactions (PSBTs) from Descriptors. Features BIP32, single-signature, and Hardware Wallet signing capabilities, and facilitates finalizing transactions.
https://bitcoinerlab.com/modules/descriptors
46 stars 14 forks source link

🐛 Allow spending multiple UTXOs from the same time-locked descriptor (#15) #16

Closed 0xbrito closed 1 year ago

0xbrito commented 1 year ago

This relates to #15

0xbrito commented 1 year ago

@landabaso could you review this, please?

landabaso commented 1 year ago

Thanks @0xbrito !

In this proposal, if the user tries to set (again) the same timelock, then undefined will be passed to src/updatePsbt.

The timelock argument in src/updatePsbt should always correspond to real, correct information or otherwise it will make the code difficult to understand and maintain in the future.

I believe what you're trying to achieve is not throwing if exactly the same timelock is being set again. I'd consider this (not sure yet), but in a more clear, not convoluted way.

landabaso commented 1 year ago

Closed in favour of: https://github.com/bitcoinerlab/descriptors/commit/f7d55dfc305677166a2afda6f48e7deb3dd81f4f

0xbrito commented 1 year ago

@landabaso Awesome!

And regarding to my proposal, I acknowledge that it was pretty much a superficial approach, it actually was just a small quick fix I added to get my app up and running. However, thanks for this!