Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #498 from blockchain/send-eth
Browse files Browse the repository at this point in the history
fix(Eth): When tx fails, send can be blocked 'waiting for confirmation'
  • Loading branch information
plondon authored Feb 2, 2018
2 parents 59e25db + 79aa80c commit f023b4e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/eth/eth-wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class EthWallet {
this._txNotes = {};
this._latestBlock = null;
this._lastTx = null;
this._lastTxTimestamp = null;
this.sync = asyncOnce(this.sync.bind(this), 250);
}

Expand Down Expand Up @@ -70,6 +71,10 @@ class EthWallet {
return this._lastTx;
}

get lastTxTimestamp () {
return this._lastTxTimestamp;
}

get defaults () {
return {
GAS_PRICE: EthTxBuilder.GAS_PRICE,
Expand Down Expand Up @@ -147,6 +152,7 @@ class EthWallet {

setLastTx (tx) {
this._lastTx = tx;
this._lastTxTimestamp = new Date().getTime();
this.sync();
}

Expand Down Expand Up @@ -178,6 +184,7 @@ class EthWallet {
this._accounts = ethereum.accounts.map(constructAccount);
this._txNotes = ethereum.tx_notes || {};
this._lastTx = ethereum.last_tx;
this._lastTxTimestamp = ethereum.last_tx_timestamp;
if (ethereum.legacy_account) {
this._legacyAccount = constructAccount(ethereum.legacy_account);
}
Expand All @@ -197,7 +204,8 @@ class EthWallet {
accounts: this._accounts,
legacy_account: this._legacyAccount,
tx_notes: this._txNotes,
last_tx: this._lastTx
last_tx: this._lastTx,
last_tx_timestamp: this._lastTxTimestamp
};
}

Expand Down

0 comments on commit f023b4e

Please sign in to comment.