Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Query wallet balance less #4114

Closed
ayumi opened this issue Sep 19, 2016 · 3 comments · Fixed by #5924
Closed

Query wallet balance less #4114

ayumi opened this issue Sep 19, 2016 · 3 comments · Fixed by #5924

Comments

@ayumi
Copy link
Contributor

ayumi commented Sep 19, 2016

Issue (🎁):
When Payments is enabled and a user wallet active, Brave queries a Bitcoin API for the wallet balance every minute.
This could be undesirable because APIs might know when browser users are online.
It is also additional load, and if we run our own blockchain API it could be intense.

Expected (📦):
Query balance only when necessary:

  • Payments pane is open
  • After reconciliation when balance drops below next reconciliation amount (? something like this)

Platform (Win7, 8, 10? macOS? Linux distro?):
all

Brave Version:
0.12.1

Steps to reproduce:
1. In ledger.js line ~1062 add logging to ledgerBalance.getBalance
2. Enable Payments and ensure a user wallet exists
3. Log output shows periodic function calls

cc @bridiver @diracdeltas @mrose17

@mrose17
Copy link
Member

mrose17 commented Sep 19, 2016

@ayumi - bonus points if you can figure out which one of the _.options._P variables should be used to enable the call to console.log

@bridiver
Copy link
Collaborator

you can get the info you need from WindowConstants.WINDOW_SET_FOCUSED_FRAME and check for the about:prefs page with the ledger anchor

@willy-b
Copy link
Contributor

willy-b commented Sep 19, 2016

@ayumi , if you run with the env variable LEDGER_VERBOSE set to true (LEDGER_VERBOSE=true npm start) @mrose17 has extensive logging in place (as he is alluding to, I think).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants