Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13114987
D11593.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D11593.diff
View Options
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
Details
Attached
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)
Attached To
D11593: [Cashtab] Patch API error handling
Event Timeline
Log In to Comment