feat: Add exclude_unconfirmed and exclude_below_confirmations#258
Conversation
Pull Request Test Coverage Report for Build 15892909684Details
💛 - Coveralls |
9bba85c to
059f6af
Compare
059f6af to
6400343
Compare
|
Looks good. I was a bit confused by the comment that refers to the |
| /// Excludes any outpoints whose enclosing transaction has fewer than `min_confirms` | ||
| /// confirmations. | ||
| /// | ||
| /// `min_confirms` is the minimum number of confirmations a transaction must have in order for |
There was a problem hiding this comment.
suggestion(doc):
min_confirmsis the minimum number of confirmations a transaction must have in order for its outpoints to be available for spend in the next block/available for selection in the current one.
There was a problem hiding this comment.
@nymius could you highlight for me what detail you think is missing in the original docs?
There was a problem hiding this comment.
As you were using the same logic that the coinbase maturity check
.map_or(0, |h| tip_height.saturating_add(1).saturating_sub(h))And the definition wasn't clear previously, I thought it was good to emphasize what spendable means: the outpoint is available for selection in the current block.
If you are expecting to make a transaction with a UTXO mined 4 blocks before, and you use exclude_below_confirmations with min_confirms = 4 you should know that same UTXO will be available for selection.
But don't consider it a blocker, if you think is not worth it.
These are convenience methods on `TxBuilder` that can be used to filter out outpoints which do not meet a given confirmation threshold.
6400343 to
5a65422
Compare
oleonardolima
left a comment
There was a problem hiding this comment.
utACK 5a65422
I agree with nymius's comments, but I also don't see it as a blocker.
|
ACK 5a65422 |
Fixes #143
Description
These are convenience methods on
TxBuilderthat can be used to filter out outpoints which do not meet a given confirmation threshold.Previously, I advocated a feature freeze on
TxBuilder, but I believe we can make an exception for these helper methods, as they do not broaden theTxBuilderinterface’s error surface. Going forward, all other development should be directed to thebdk-txrepository and crate.cc. @tnull
Changelog notice
Checklists
All Submissions:
cargo +nightly fmtandcargo clippybefore committingNew Features: