Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Commit

Permalink
feat: ensure setting account hash/height triggers saveState
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Werner committed Feb 8, 2021
1 parent 06ebb89 commit 013e65e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ module.exports = function setLastSyncedBlockHeight(hash) {
const accountsStore = this.storage.store.wallets[walletId].accounts;

const accountStore = (this.walletType === WALLET_TYPES.SINGLE_ADDRESS)
? accountsStore[this.index.toString()]
: accountsStore[this.BIP44PATH.toString()];
? accountsStore[this.index.toString()]
: accountsStore[this.BIP44PATH.toString()];

accountStore.blockHash = hash;

this.storage.store.lastModified = +new Date();
return accountStore.blockHash;
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ module.exports = function setLastSyncedBlockHeight(blockHeight) {
const accountsStore = this.storage.store.wallets[walletId].accounts;

const accountStore = (this.walletType === WALLET_TYPES.SINGLE_ADDRESS)
? accountsStore[this.index.toString()]
: accountsStore[this.BIP44PATH.toString()];
? accountsStore[this.index.toString()]
: accountsStore[this.BIP44PATH.toString()];

accountStore.blockHeight = blockHeight;

this.storage.store.lastModified = +new Date();
return accountStore.blockHeight;
};

0 comments on commit 013e65e

Please sign in to comment.