diff --git a/src/LedgerConsensus.cpp b/src/LedgerConsensus.cpp index 2e57baea9e..f3243a76b6 100644 --- a/src/LedgerConsensus.cpp +++ b/src/LedgerConsensus.cpp @@ -917,6 +917,23 @@ void LedgerConsensus::accept(SHAMap::pointer set) mState = lcsACCEPTED; sl.unlock(); + { + Log(lsINFO) << "We closed at " << boost::lexical_cast(mCloseTime); + uint64 closeTotal = mCloseTime; + int closeCount = 1; + for(std::map::iterator it = mCloseTimes.begin(), end = mCloseTimes.end(); it != end; ++it) + { + Log(lsINFO) << boost::lexical_cast(it->second) << " time votes for " + << boost::lexical_cast(it->first); + closeCount += it->second; + closeTotal += static_cast(it->first) * static_cast(it->second); + } + closeTotal += (closeCount / 2); + closeTotal /= closeCount; + int offset = static_cast(closeTotal) - static_cast(mCloseTime); + Log(lsINFO) << "Our clock offset is estimated at " << offset; + } + #ifdef DEBUG Json::StyledStreamWriter ssw; if (1)