diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -566,6 +566,7 @@ avalanche/voterecord.cpp banman.cpp blockencodings.cpp + blockfileinfo.cpp blockfilter.cpp blockindex.cpp chain.cpp diff --git a/src/blockfileinfo.cpp b/src/blockfileinfo.cpp new file mode 100644 --- /dev/null +++ b/src/blockfileinfo.cpp @@ -0,0 +1,15 @@ +// Copyright (c) 2022 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include + +#include +#include + +std::string CBlockFileInfo::ToString() const { + return strprintf( + "CBlockFileInfo(blocks=%u, size=%u, heights=%u...%u, time=%s...%s)", + nBlocks, nSize, nHeightFirst, nHeightLast, + FormatISO8601DateTime(nTimeFirst), FormatISO8601DateTime(nTimeLast)); +} diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -521,16 +521,7 @@ 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, - FormatISO8601DateTime(nTimeFirst), FormatISO8601DateTime(nTimeLast)); -} -namespace node { CBlockFileInfo *BlockManager::GetBlockFileInfo(size_t n) { LOCK(cs_LastBlockFile);