Skip to content

Commit 809b571

Browse files
committed
Single diff in blockToJSON
1 parent ebd4395 commit 809b571

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/rpc/blockchain.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,7 @@ UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool tx
130130
result.push_back(Pair("mediantime", (int64_t)blockindex->GetMedianTimePast()));
131131
result.push_back(Pair("nonce", (uint64_t)block.nNonce));
132132
result.push_back(Pair("bits", strprintf("%08x", block.nBits)));
133-
UniValue diff(UniValue::VOBJ);
134-
diff.push_back(Pair("proof-of-work", GetDifficulty()));
135-
diff.push_back(Pair("proof-of-stake", GetDifficulty(GetLastBlockIndex(chainActive.Tip(), true))));
136-
result.push_back(Pair("difficulty", diff));
133+
result.push_back(Pair("difficulty", GetDifficulty(blockindex)));
137134
result.push_back(Pair("chainwork", blockindex->nChainWork.GetHex()));
138135
result.push_back(Pair("flags", strprintf("%s%s", blockindex->IsProofOfStake() ? "proof-of-stake" : "proof-of-work", blockindex->GeneratedStakeModifier() ? " stake-modifier": "")));
139136
result.push_back(Pair("proofhash", blockindex->IsProofOfStake() ? blockindex->hashProof.GetHex() : blockindex->GetBlockHash().GetHex()));

0 commit comments

Comments
 (0)