Browse Source

FIX: Removed unnecessary code.

psbt
Marcos Rodriguez 5 years ago
parent
commit
b22545ace4
  1. 2
      App.js
  2. 4
      class/abstract-wallet.js
  3. 2
      screen/receive/details.js

2
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 &&

4
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

2
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
}

Loading…
Cancel
Save