-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or request
Description
The Wallet::balance method is currently limited in that you can only assign trust to an indexed script pubkey, however one might reasonably assume that a txout can be trusted if it resides on a transaction where all of the inputs are controlled by the same wallet, and hence not likely to be double-spent unintentionally. One way to approach this is to redefine trust_predicate to operate on a particular outpoint of interest.
Proposed API
/// Compute the wallet balance with the default parameters.
pub fn balance(&self) -> Balance { ... }
/// Compute the wallet balance with canonical params, confirmation threshold, and trust predicate.
pub fn balance_with_params_conf_threshold(
&self,
params: CanonicalizationParams,
conf_threshold: u32,
trust_predicate: impl Fn(&OutPoint) -> bool,
) -> Balance
{ ... }Additional context
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request