Skip to content

Commit

Permalink
tolerate missing fees field from fee estimate
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed Aug 20, 2024
1 parent e8a874a commit 2fc3b0b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/main/java/monero/daemon/MoneroDaemonRpc.java
Original file line number Diff line number Diff line change
Expand Up @@ -542,11 +542,15 @@ public MoneroFeeEstimate getFeeEstimate(Integer graceBlocks) {
Map<String, Object> resp = rpc.sendJsonRequest("get_fee_estimate");
Map<String, Object> result = (Map<String, Object>) resp.get("result");
checkResponseStatus(result);
List<BigInteger> fees = new ArrayList<BigInteger>();
for (BigInteger fee : (List<BigInteger>) result.get("fees")) fees.add(fee);
BigInteger fee = (BigInteger) result.get("fee");
BigInteger quantizationMask = (BigInteger) result.get("quantization_mask");
return new MoneroFeeEstimate(fee, fees, quantizationMask);
MoneroFeeEstimate feeEstimate = new MoneroFeeEstimate();
feeEstimate.setFee((BigInteger) result.get("fee"));
feeEstimate.setQuantizationMask((BigInteger) result.get("quantization_mask"));
if (result.containsKey("fees")) {
List<BigInteger> fees = new ArrayList<BigInteger>();
for (BigInteger fee : (List<BigInteger>) result.get("fees")) fees.add(fee);
feeEstimate.setFees(fees);
}
return feeEstimate;
}

@Override
Expand Down

0 comments on commit 2fc3b0b

Please sign in to comment.