From b22545ace4a9b8f0adeb149e525e19b1d82b871f Mon Sep 17 00:00:00 2001 From: Marcos Rodriguez Date: Wed, 11 Sep 2019 21:59:11 -0400 Subject: [PATCH] FIX: Removed unnecessary code. --- App.js | 2 +- class/abstract-wallet.js | 4 ++++ screen/receive/details.js | 2 -- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/App.js b/App.js index d0e7b662..4a022263 100644 --- a/App.js +++ b/App.js @@ -49,7 +49,7 @@ export default class App extends React.Component { if (this.state.appState.match(/inactive|background/) && nextAppState === 'active') { const clipboard = await Clipboard.getString(); const isAddressFromStoredWallet = BlueApp.getWallets().some(wallet => - wallet.chain === Chain.ONCHAIN ? wallet._address === clipboard : wallet.isInvoiceGeneratedByWallet(clipboard), + wallet.chain === Chain.ONCHAIN ? wallet.weOwnAddress(clipboard) : wallet.isInvoiceGeneratedByWallet(clipboard), ); if ( this.state.clipboardContent !== clipboard && diff --git a/class/abstract-wallet.js b/class/abstract-wallet.js index a7584907..9d57204e 100644 --- a/class/abstract-wallet.js +++ b/class/abstract-wallet.js @@ -84,6 +84,10 @@ export class AbstractWallet { return false; } + weOwnAddress(address) { + return this._address === address; + } + /** * Returns delta of unconfirmed balance. For example, if theres no * unconfirmed balance its 0 diff --git a/screen/receive/details.js b/screen/receive/details.js index 9a4f9e43..deabf807 100644 --- a/screen/receive/details.js +++ b/screen/receive/details.js @@ -58,13 +58,11 @@ export default class ReceiveDetails extends Component { if (wallet.getAddressAsync) { try { address = await Promise.race([wallet.getAddressAsync(), BlueApp.sleep(1000)]); - wallet._address = address; } catch (_) {} if (!address) { // either sleep expired or getAddressAsync threw an exception console.warn('either sleep expired or getAddressAsync threw an exception'); address = wallet._getExternalAddressByIndex(wallet.next_free_address_index); - wallet._address = address; } BlueApp.saveToDisk(); // caching whatever getAddressAsync() generated internally }