Always show fields that contribute to the hash in ledger header json

This commit is contained in:
Nicholas Dudfield
2015-08-11 10:46:59 +07:00
committed by Scott Schurr
parent d5193a776e
commit 377e3d479c
2 changed files with 8 additions and 3 deletions

View File

@@ -65,14 +65,17 @@ void fillJson(Object& json, LedgerInfo const& info, bool bFull)
json[jss::hash] = to_string (info.hash); json[jss::hash] = to_string (info.hash);
json[jss::totalCoins] = to_string (info.drops); json[jss::totalCoins] = to_string (info.drops);
json[jss::accepted] = ! info.open; json[jss::accepted] = ! info.open;
json[jss::close_flags] = info.closeFlags;
// Always show fields that contribute to the ledger hash
json[jss::parent_close_time] = info.parentCloseTime;
json[jss::close_time] = info.closeTime;
json[jss::close_time_resolution] = info.closeTimeResolution;
if (auto closeTime = info.closeTime) if (auto closeTime = info.closeTime)
{ {
json[jss::close_time] = closeTime;
json[jss::close_time_human] = boost::posix_time::to_simple_string ( json[jss::close_time_human] = boost::posix_time::to_simple_string (
ptFromSeconds (closeTime)); ptFromSeconds (closeTime));
json[jss::close_time_resolution] = info.closeTimeResolution;
if (! getCloseAgree(info)) if (! getCloseAgree(info))
json[jss::close_time_estimated] = true; json[jss::close_time_estimated] = true;
} }

View File

@@ -96,6 +96,7 @@ JSS ( build_version ); // out: NetworkOPs
JSS ( can_delete ); // out: CanDelete JSS ( can_delete ); // out: CanDelete
JSS ( check_nodes ); // in: LedgerCleaner JSS ( check_nodes ); // in: LedgerCleaner
JSS ( clear ); // in/out: FetchInfo JSS ( clear ); // in/out: FetchInfo
JSS ( close_flags ); // out: LedgerToJson
JSS ( close_time ); // in: Application, out: NetworkOPs, JSS ( close_time ); // in: Application, out: NetworkOPs,
// LedgerProposal, LedgerToJson // LedgerProposal, LedgerToJson
JSS ( close_time_estimated ); // in: Application, out: LedgerToJson JSS ( close_time_estimated ); // in: Application, out: LedgerToJson
@@ -262,6 +263,7 @@ JSS ( open ); // out: handlers/Ledger
JSS ( owner ); // in: LedgerEntry, out: NetworkOPs JSS ( owner ); // in: LedgerEntry, out: NetworkOPs
JSS ( owner_funds ); // out: NetworkOPs, AcceptedLedgerTx JSS ( owner_funds ); // out: NetworkOPs, AcceptedLedgerTx
JSS ( params ); // RPC JSS ( params ); // RPC
JSS ( parent_close_time ); // out: LedgerToJson
JSS ( parent_hash ); // out: LedgerToJson JSS ( parent_hash ); // out: LedgerToJson
JSS ( partition ); // in: LogLevel JSS ( partition ); // in: LogLevel
JSS ( passphrase ); // in: WalletPropose JSS ( passphrase ); // in: WalletPropose