FIX: rare crash on watch-only receive button

This commit is contained in:
Overtorment 2020-09-19 23:53:08 +01:00
parent 532653ecca
commit 89d1e42216
2 changed files with 2 additions and 2 deletions

View File

@ -120,7 +120,7 @@ export class WatchOnlyWallet extends LegacyWallet {
throw new Error('Not initialized');
}
async _getExternalAddressByIndex(index) {
_getExternalAddressByIndex(index) {
if (this._hdWalletInstance) return this._hdWalletInstance._getExternalAddressByIndex(index);
throw new Error('Not initialized');
}

View File

@ -193,7 +193,7 @@ const ReceiveDetails = () => {
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);
address = wallet._getExternalAddressByIndex(wallet.getNextFreeAddressIndex());
} else {
BlueApp.saveToDisk(); // caching whatever getAddressAsync() generated internally
}