Skip to content

Commit e5b6aef

Browse files
committed
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
1 parent f7086fd commit e5b6aef

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/chain.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

66
#include <chain.h>
7+
#include <util/time.h>
8+
9+
std::string CBlockFileInfo::ToString() const
10+
{
11+
return strprintf("CBlockFileInfo(blocks=%u, size=%u, heights=%u...%u, time=%s...%s)", nBlocks, nSize, nHeightFirst, nHeightLast, FormatISO8601Date(nTimeFirst), FormatISO8601Date(nTimeLast));
12+
}
713

814
void CChain::SetTip(CBlockIndex *pindex) {
915
if (pindex == nullptr) {

src/node/blockstorage.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -473,14 +473,7 @@ void CleanupBlockRevFiles()
473473
remove(item.second);
474474
}
475475
}
476-
} // namespace node
477476

478-
std::string CBlockFileInfo::ToString() const
479-
{
480-
return strprintf("CBlockFileInfo(blocks=%u, size=%u, heights=%u...%u, time=%s...%s)", nBlocks, nSize, nHeightFirst, nHeightLast, FormatISO8601Date(nTimeFirst), FormatISO8601Date(nTimeLast));
481-
}
482-
483-
namespace node {
484477
CBlockFileInfo* BlockManager::GetBlockFileInfo(size_t n)
485478
{
486479
LOCK(cs_LastBlockFile);

0 commit comments

Comments
 (0)