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