@@ -1423,9 +1423,14 @@ void toJsonValue(rapidjson::Writer<epee::byte_stream>& dest, const cryptonote::r
1423
1423
{
1424
1424
dest.StartObject ();
1425
1425
1426
+ const uint64_t difficulty_top64 = (info.wide_difficulty >> 64 ).convert_to <std::uint64_t >();
1427
+ const uint64_t cumulative_difficulty_top64 = (info.wide_cumulative_difficulty >> 64 ).convert_to <std::uint64_t >();
1428
+
1426
1429
INSERT_INTO_JSON_OBJECT (dest, height, info.height );
1427
1430
INSERT_INTO_JSON_OBJECT (dest, target_height, info.target_height );
1431
+ INSERT_INTO_JSON_OBJECT (dest, top_block_height, info.top_block_height );
1428
1432
INSERT_INTO_JSON_OBJECT (dest, difficulty, info.difficulty );
1433
+ INSERT_INTO_JSON_OBJECT (dest, difficulty_top64, difficulty_top64);
1429
1434
INSERT_INTO_JSON_OBJECT (dest, target, info.target );
1430
1435
INSERT_INTO_JSON_OBJECT (dest, tx_count, info.tx_count );
1431
1436
INSERT_INTO_JSON_OBJECT (dest, tx_pool_size, info.tx_pool_size );
@@ -1440,12 +1445,14 @@ void toJsonValue(rapidjson::Writer<epee::byte_stream>& dest, const cryptonote::r
1440
1445
INSERT_INTO_JSON_OBJECT (dest, nettype, info.nettype );
1441
1446
INSERT_INTO_JSON_OBJECT (dest, top_block_hash, info.top_block_hash );
1442
1447
INSERT_INTO_JSON_OBJECT (dest, cumulative_difficulty, info.cumulative_difficulty );
1448
+ INSERT_INTO_JSON_OBJECT (dest, cumulative_difficulty_top64, cumulative_difficulty_top64);
1443
1449
INSERT_INTO_JSON_OBJECT (dest, block_size_limit, info.block_size_limit );
1444
1450
INSERT_INTO_JSON_OBJECT (dest, block_weight_limit, info.block_weight_limit );
1445
1451
INSERT_INTO_JSON_OBJECT (dest, block_size_median, info.block_size_median );
1446
1452
INSERT_INTO_JSON_OBJECT (dest, block_weight_median, info.block_weight_median );
1447
1453
INSERT_INTO_JSON_OBJECT (dest, adjusted_time, info.adjusted_time );
1448
1454
INSERT_INTO_JSON_OBJECT (dest, start_time, info.start_time );
1455
+ INSERT_INTO_JSON_OBJECT (dest, version, info.version );
1449
1456
1450
1457
dest.EndObject ();
1451
1458
}
@@ -1457,9 +1464,14 @@ void fromJsonValue(const rapidjson::Value& val, cryptonote::rpc::DaemonInfo& inf
1457
1464
throw WRONG_TYPE (" json object" );
1458
1465
}
1459
1466
1467
+ uint64_t difficulty_top64 = 0 ;
1468
+ uint64_t cumulative_difficulty_top64 = 0 ;
1469
+
1460
1470
GET_FROM_JSON_OBJECT (val, info.height , height);
1461
1471
GET_FROM_JSON_OBJECT (val, info.target_height , target_height);
1472
+ GET_FROM_JSON_OBJECT (val, info.top_block_height , top_block_height);
1462
1473
GET_FROM_JSON_OBJECT (val, info.difficulty , difficulty);
1474
+ GET_FROM_JSON_OBJECT (val, difficulty_top64, difficulty_top64);
1463
1475
GET_FROM_JSON_OBJECT (val, info.target , target);
1464
1476
GET_FROM_JSON_OBJECT (val, info.tx_count , tx_count);
1465
1477
GET_FROM_JSON_OBJECT (val, info.tx_pool_size , tx_pool_size);
@@ -1474,12 +1486,22 @@ void fromJsonValue(const rapidjson::Value& val, cryptonote::rpc::DaemonInfo& inf
1474
1486
GET_FROM_JSON_OBJECT (val, info.nettype , nettype);
1475
1487
GET_FROM_JSON_OBJECT (val, info.top_block_hash , top_block_hash);
1476
1488
GET_FROM_JSON_OBJECT (val, info.cumulative_difficulty , cumulative_difficulty);
1489
+ GET_FROM_JSON_OBJECT (val, cumulative_difficulty_top64, cumulative_difficulty_top64);
1477
1490
GET_FROM_JSON_OBJECT (val, info.block_size_limit , block_size_limit);
1478
1491
GET_FROM_JSON_OBJECT (val, info.block_weight_limit , block_weight_limit);
1479
1492
GET_FROM_JSON_OBJECT (val, info.block_size_median , block_size_median);
1480
1493
GET_FROM_JSON_OBJECT (val, info.block_weight_median , block_weight_median);
1481
1494
GET_FROM_JSON_OBJECT (val, info.adjusted_time , adjusted_time);
1482
1495
GET_FROM_JSON_OBJECT (val, info.start_time , start_time);
1496
+ GET_FROM_JSON_OBJECT (val, info.version , version);
1497
+
1498
+ info.wide_difficulty = difficulty_top64;
1499
+ info.wide_difficulty <<= 64 ;
1500
+ info.wide_difficulty += info.difficulty ;
1501
+
1502
+ info.wide_cumulative_difficulty = cumulative_difficulty_top64;
1503
+ info.wide_cumulative_difficulty <<= 64 ;
1504
+ info.wide_cumulative_difficulty += info.cumulative_difficulty ;
1483
1505
}
1484
1506
1485
1507
void toJsonValue (rapidjson::Writer<epee::byte_stream>& dest, const cryptonote::rpc::output_distribution& dist)
0 commit comments