Skip to content

Commit

Permalink
fix: graceful fallback when minimum balance request fails (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarry authored and mvines committed Jun 15, 2020
1 parent ef0bad0 commit d4a2384
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web3.js/src/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,8 @@ export class Connection {
);
const res = GetMinimumBalanceForRentExemptionRpcResult(unsafeRes);
if (res.error) {
throw new Error(res.error.message);
console.warn("Unable to fetch minimum balance for rent exemption");
return 0;
}
assert(typeof res.result !== 'undefined');
return Number(res.result);
Expand Down

0 comments on commit d4a2384

Please sign in to comment.