scan only for 0.15 nodes (#634)

This commit is contained in:
m2049r 2019-11-10 12:13:06 +01:00 committed by GitHub
parent 551c3b9fb6
commit 08e8a48138
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -235,10 +235,10 @@ public class NodeInfo extends Node {
String rpcVersion = json.getString("jsonrpc");
if (!RPC_VERSION.equals(rpcVersion))
return false;
if (!json.has("credits")) // introduced in monero v0.15.0
final JSONObject result = json.getJSONObject("result");
if (!result.has("credits")) // introduced in monero v0.15.0
return false;
final JSONObject header = json.getJSONObject(
"result").getJSONObject("block_header");
final JSONObject header = result.getJSONObject("block_header");
height = header.getLong("height");
timestamp = header.getLong("timestamp");
majorVersion = header.getInt("major_version");