Page MenuHomePhabricator

D11593.diff
No OneTemporary

D11593.diff

diff --git a/web/cashtab/src/hooks/useBCH.js b/web/cashtab/src/hooks/useBCH.js
--- a/web/cashtab/src/hooks/useBCH.js
+++ b/web/cashtab/src/hooks/useBCH.js
@@ -566,6 +566,7 @@
return utxosResponse.utxos;
} catch (err) {
console.log(`Error in BCH.Electrumx.utxo(addresses):`);
+ console.log(err);
return err;
}
};
diff --git a/web/cashtab/src/hooks/useWallet.js b/web/cashtab/src/hooks/useWallet.js
--- a/web/cashtab/src/hooks/useWallet.js
+++ b/web/cashtab/src/hooks/useWallet.js
@@ -229,7 +229,13 @@
const utxos = await getUtxos(BCH, cashAddresses);
// If an error is returned or utxos from only 1 address are returned
- if (!utxos || isEmpty(utxos) || utxos.error || utxos.length < 2) {
+ if (
+ !utxos ||
+ !Array.isArray(utxos) ||
+ isEmpty(utxos) ||
+ utxos.error ||
+ utxos.length < 2
+ ) {
// Throw error here to prevent more attempted api calls
// as you are likely already at rate limits
throw new Error('Error fetching utxos');

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 1, 09:03 (14 m, 7 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187158
Default Alt Text
D11593.diff (1 KB)

Event Timeline