mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-22 23:08:07 +01:00
REF: better LN wallet refresh strategy
This commit is contained in:
parent
3afeefaed9
commit
042a9e4d85
2 changed files with 3 additions and 2 deletions
|
@ -55,11 +55,11 @@ export class LightningCustodianWallet extends LegacyWallet {
|
|||
}
|
||||
|
||||
timeToRefreshBalance() {
|
||||
return (+new Date() - this._lastBalanceFetch) / 1000 > 3600; // 1hr
|
||||
return (+new Date() - this._lastBalanceFetch) / 1000 > 300; // 5 min
|
||||
}
|
||||
|
||||
timeToRefreshTransaction() {
|
||||
return (+new Date() - this._lastTxFetch) / 1000 > 3600; // 1hr
|
||||
return (+new Date() - this._lastTxFetch) / 1000 > 300; // 5 min
|
||||
}
|
||||
|
||||
static fromJson(param) {
|
||||
|
|
|
@ -191,6 +191,7 @@ export default class WalletsList extends Component {
|
|||
}
|
||||
if (wallets[index].fetchUserInvoices) {
|
||||
await wallets[index].fetchUserInvoices();
|
||||
await wallets[index].fetchBalance(); // chances are, paid ln invoice was processed during `fetchUserInvoices()` call and altered user's balance, so its worth fetching balance again
|
||||
}
|
||||
this.redrawScreen();
|
||||
didRefresh = true;
|
||||
|
|
Loading…
Add table
Reference in a new issue