Updated on 2026-08-14
This commit is contained in:
commit
d4e76c4a00
4 changed files with 38 additions and 15 deletions
|
|
@ -156,11 +156,20 @@ public class ElectrumRequest {
|
|||
}
|
||||
|
||||
public JSONObject getError() throws JSONException {
|
||||
return getAnswer().getJSONObject("error");
|
||||
JSONObject answer = getAnswer();
|
||||
if (answer.has("error")) {
|
||||
return getAnswer().getJSONObject("error");
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getResultString() throws JSONException {
|
||||
return getAnswer().getString("result");
|
||||
if (getAnswer().has("result")) {
|
||||
return getAnswer().getString("result");
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public JSONArray getResultArray() throws JSONException {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue