Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIF Sweeping/Watchtower Race-Condition #414

Open
jimtendo opened this issue Oct 20, 2024 · 0 comments
Open

WIF Sweeping/Watchtower Race-Condition #414

jimtendo opened this issue Oct 20, 2024 · 0 comments

Comments

@jimtendo
Copy link

Hi Paytaca Team,

There appears to be a race-condition of sorts with the Sweep function of Paytaca.

The way this works currently is that, upon sweeping:

  1. A subscribe call is made to Watchtower
  2. A follow-up getBalance call is then made

https://github.com/paytaca/paytaca-app/blob/master/src/wallet/sweep.js#L17

The subscription call will not trigger an immediate refresh of the balance in Watchtower in many cases. This means if funding of a WIF takes place outside of a Paytaca Wallet and a user attempts to sweep it from within Paytaca, the balance will often show as zero.

In personal testing, I have noticed that sometimes, after trying an initial sweep that shows balance as zero, I can come back a few minutes later and it'll show (but this does not seem to happen in all cases - one suspicion I had is that it might be refreshing, after subscription, on block confirmations, but am not certain on that).

For the CashStamps use-case, I've hacked in a temporary work-around here that attempts to subscribe the addresses to Watchtower before funding takes place:

https://github.com/harvmaster/CashStamps/blob/main/src/components/FundingDialog.vue#L195

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

No branches or pull requests

1 participant