Skip to content

lock inputs via strategies and unlock early due to payment anxiety#8

Open
Mshehu5 wants to merge 1 commit intopayjoin:masterfrom
Mshehu5:lock
Open

lock inputs via strategies and unlock early due to payment anxiety#8
Mshehu5 wants to merge 1 commit intopayjoin:masterfrom
Mshehu5:lock

Conversation

@Mshehu5
Copy link
Contributor

@Mshehu5 Mshehu5 commented Mar 1, 2026

this PR aims to address two TODO in unspent coin wallet.rs L159-160

// TODO Startegies should inform which inputs can be spendable.
// TODO: these inputs should unlock if the payjoin is expired or the associated payment obligation is due soon (i.e payment anxiety)
coins are now locked when used by a strategy and unlock when expired or due to payment anxiety(payment obligation almost due) which is currently implemented as if less than 10% of your deadline window remains this will unlock the coins. This threshold can be changed as is just a value

@Mshehu5 Mshehu5 force-pushed the lock branch 2 times, most recently from 425cef2 to bb8c115 Compare March 1, 2026 14:14
Copy link
Contributor

@0xZaddyy 0xZaddyy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good implementation @Mshehu5 :)

@Mshehu5 Mshehu5 force-pushed the lock branch 2 times, most recently from 655eff5 to 9c8ae45 Compare March 1, 2026 20:39
fn unspent_coins(&self) -> impl Iterator<Item = OutputHandle<'a>> + '_ {
self.potentially_spendable_txos().filter(|o| {
!self.info().unconfirmed_spends.contains(&o.outpoint())
// TODO Startegies should inform which inputs can be spendable.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize this may have been misleading. Wallets should mark utxos as locked as secondary information (WalletInfo). Perhaps a better name for it could be: "used_utxos". This information should not live in the strategy struct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants