MetacoSA / NBitcoin

Comprehensive Bitcoin library for the .NET framework.
MIT License
1.87k stars 846 forks source link

Feature request: Add ability to set sequence number of inputs on TransactionBuilder #973

Closed canndrew closed 3 years ago

canndrew commented 3 years ago

Currently there's no way (as far as I can tell) to set the sequence number of a txin when building a transaction using TransactionBuilder, beyond setting it to OptInRBF. It might be nice to have a method like TransactionBuilder.AddCoinWithSequence(ICoin coin, Sequence sequence) or perhaps extend Coin itself with a Sequence field, or perhaps extend the API in some other way to achieve the same thing.

I'm happy to implement this myself but I'd like to hear opinions first on what the most appropriate way would be.

NicolasDorier commented 3 years ago

I think that's good idea. Instead of doing AddCoinWithSequence can you instead add a overload to AddCoin() with a CoinOptions class. Then in this CoinOptions, jus add a single Sequence property.