Browse Source
Merge pull request #1326 from gre/refresh-eth-balance-even-if-no-txs
Refresh ETH balance even if there is still no txs
master
Gaëtan Renaudeau
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
3 deletions
-
src/bridge/EthereumJSBridge.js
|
|
@ -199,7 +199,7 @@ const EthereumBridge: WalletBridge<Transaction> = { |
|
|
|
const freshAddress = address |
|
|
|
const accountId = `ethereumjs:${currency.id}:${address}:${publicKey}` |
|
|
|
|
|
|
|
if (txs.length === 0) { |
|
|
|
if (txs.length === 0 && balance.isZero()) { |
|
|
|
// this is an empty account
|
|
|
|
if (isStandard) { |
|
|
|
if (newAccountCount === 0) { |
|
|
@ -322,17 +322,18 @@ const EthereumBridge: WalletBridge<Transaction> = { |
|
|
|
const blockHash = operations.length > 0 ? operations[0].blockHash : undefined |
|
|
|
const { txs } = await api.getTransactions(freshAddress, blockHash) |
|
|
|
if (unsubscribed) return |
|
|
|
const balance = await api.getAccountBalance(freshAddress) |
|
|
|
if (unsubscribed) return |
|
|
|
if (txs.length === 0) { |
|
|
|
o.next(a => ({ |
|
|
|
...a, |
|
|
|
balance, |
|
|
|
blockHeight: block.height, |
|
|
|
lastSyncDate: new Date(), |
|
|
|
})) |
|
|
|
o.complete() |
|
|
|
return |
|
|
|
} |
|
|
|
const balance = await api.getAccountBalance(freshAddress) |
|
|
|
if (unsubscribed) return |
|
|
|
const nonce = await api.getAccountNonce(freshAddress) |
|
|
|
if (unsubscribed) return |
|
|
|
o.next(a => { |
|
|
|