@@ -1299,6 +1299,8 @@ RPCHelpMan getblockchaininfo()
1299
1299
{RPCResult::Type::NUM, " blocks" , " the height of the most-work fully-validated chain. The genesis block has height 0" },
1300
1300
{RPCResult::Type::NUM, " headers" , " the current number of headers we have validated" },
1301
1301
{RPCResult::Type::STR, " bestblockhash" , " the hash of the currently best block" },
1302
+ {RPCResult::Type::STR_HEX, " bits" , " nBits: compact representation of the block difficulty target" },
1303
+ {RPCResult::Type::STR_HEX, " target" , " The difficulty target" },
1302
1304
{RPCResult::Type::NUM, " difficulty" , " the current difficulty" },
1303
1305
{RPCResult::Type::NUM_TIME, " time" , " The block time expressed in " + UNIX_EPOCH_TIME},
1304
1306
{RPCResult::Type::NUM_TIME, " mediantime" , " The median block time expressed in " + UNIX_EPOCH_TIME},
@@ -1337,6 +1339,8 @@ RPCHelpMan getblockchaininfo()
1337
1339
obj.pushKV (" blocks" , height);
1338
1340
obj.pushKV (" headers" , chainman.m_best_header ? chainman.m_best_header ->nHeight : -1 );
1339
1341
obj.pushKV (" bestblockhash" , tip.GetBlockHash ().GetHex ());
1342
+ obj.pushKV (" bits" , strprintf (" %08x" , tip.nBits ));
1343
+ obj.pushKV (" target" , GetTarget (tip, chainman.GetConsensus ().powLimit ).GetHex ());
1340
1344
obj.pushKV (" difficulty" , GetDifficulty (tip));
1341
1345
obj.pushKV (" time" , tip.GetBlockTime ());
1342
1346
obj.pushKV (" mediantime" , tip.GetMedianTimePast ());
0 commit comments