Move CBlockFileInfo::ToString method where class is declared

CBlockFileInfo class is declared in src/chain.h, so move ToString
definition to src/chain.cpp instead of src/node/blockstorage.cpp
This commit is contained in:
Russell Yanofsky
2021-12-08 08:01:46 -05:00
parent f7086fd8ff
commit e5b6aef612
2 changed files with 6 additions and 7 deletions

View File

@@ -4,6 +4,12 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <chain.h>
#include <util/time.h>
std::string CBlockFileInfo::ToString() const
{
return strprintf("CBlockFileInfo(blocks=%u, size=%u, heights=%u...%u, time=%s...%s)", nBlocks, nSize, nHeightFirst, nHeightLast, FormatISO8601Date(nTimeFirst), FormatISO8601Date(nTimeLast));
}
void CChain::SetTip(CBlockIndex *pindex) {
if (pindex == nullptr) {

View File

@@ -473,14 +473,7 @@ void CleanupBlockRevFiles()
remove(item.second);
}
}
} // namespace node
std::string CBlockFileInfo::ToString() const
{
return strprintf("CBlockFileInfo(blocks=%u, size=%u, heights=%u...%u, time=%s...%s)", nBlocks, nSize, nHeightFirst, nHeightLast, FormatISO8601Date(nTimeFirst), FormatISO8601Date(nTimeLast));
}
namespace node {
CBlockFileInfo* BlockManager::GetBlockFileInfo(size_t n)
{
LOCK(cs_LastBlockFile);