You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a transaction I want to ensure it cannot be doublespent.
If I use an unconfirmed and untrusted prevout, I cannot guarantee the transaction will not be doublespent
Additional context
The text was updated successfully, but these errors were encountered:
As an alternative to the enum idea, I think we could easily represent the confirmation policy as a BTreeMap<KeychainKind, u32> where an entry defines the number of confirmations needed to spend an output on that keychain. The API could look like this
/// The inputs to the transaction must be confirmed...pubfnmust_use_confirmed(&mutself) -> &mutSelf{// ensure that each value in the map is at least 1// ...}/// Minimum number `n` of confirmations required to spend a UTXO of the given `keychain`.pubfnmin_confs(&mutself,keychain:KeychainKind,n:u32) -> &mutSelf{self.params.confirmation_policy.insert(keychain, n);self}
Describe the enhancement
I want to create a transaction and ensure that prevout has been confirmed onchain.
Similar to
ChangeSpendPolicy
I'd like to introduce aConfirmationSpendPolicy
.This could be used to spend only
Confirmed
,Trusted
orAny
output.The code to use it could look like the example below
Use case
When creating a transaction I want to ensure it cannot be doublespent.
If I use an unconfirmed and untrusted prevout, I cannot guarantee the transaction will not be doublespent
Additional context
The text was updated successfully, but these errors were encountered: