mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-13 11:09:20 +01:00
REF: last tx fetch time (rel #2963)
This commit is contained in:
parent
ad931ec3f9
commit
bdb2bd9fa1
3 changed files with 16 additions and 1 deletions
|
@ -37,6 +37,13 @@ export class AbstractWallet {
|
|||
this._utxoMetadata = {};
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {number} Timestamp (millisecsec) of when last transactions were fetched from the network
|
||||
*/
|
||||
getLastTxFetch() {
|
||||
return this._lastTxFetch;
|
||||
}
|
||||
|
||||
getID() {
|
||||
return createHash('sha256').update(this.getSecret()).digest().toString('hex');
|
||||
}
|
||||
|
|
|
@ -16,6 +16,14 @@ export class WatchOnlyWallet extends LegacyWallet {
|
|||
this.masterFingerprint = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
getLastTxFetch() {
|
||||
if (this._hdWalletInstance) return this._hdWalletInstance.getLastTxFetch();
|
||||
return super.getLastTxFetch();
|
||||
}
|
||||
|
||||
allowSend() {
|
||||
return this.useWithHardwareWalletEnabled() && this.isHd() && this._hdWalletInstance.allowSend();
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ const WalletTransactions = () => {
|
|||
|
||||
// refresh transactions if it never hasn't been done. It could be a fresh imported wallet
|
||||
useEffect(() => {
|
||||
if (wallet._lastTxFetch === 0) {
|
||||
if (wallet.getLastTxFetch() === 0) {
|
||||
refreshTransactions();
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
|
|
Loading…
Add table
Reference in a new issue