mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 02:25:40 +01:00
refactor: move CBlockIndex#ToString() from header to implementation
which allows dropping tinyformat.h from the header file.
This commit is contained in:
parent
57865eb512
commit
3a61fc56a0
@ -4,6 +4,7 @@
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <chain.h>
|
||||
#include <tinyformat.h>
|
||||
#include <util/time.h>
|
||||
|
||||
std::string CBlockFileInfo::ToString() const
|
||||
@ -11,6 +12,12 @@ 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));
|
||||
}
|
||||
|
||||
std::string CBlockIndex::ToString() const
|
||||
{
|
||||
return strprintf("CBlockIndex(pprev=%p, nHeight=%d, merkle=%s, hashBlock=%s)",
|
||||
pprev, nHeight, hashMerkleRoot.ToString(), GetBlockHash().ToString());
|
||||
}
|
||||
|
||||
void CChain::SetTip(CBlockIndex *pindex) {
|
||||
if (pindex == nullptr) {
|
||||
vChain.clear();
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include <flatfile.h>
|
||||
#include <primitives/block.h>
|
||||
#include <sync.h>
|
||||
#include <tinyformat.h>
|
||||
#include <uint256.h>
|
||||
|
||||
#include <vector>
|
||||
@ -302,13 +301,7 @@ public:
|
||||
return pbegin[(pend - pbegin) / 2];
|
||||
}
|
||||
|
||||
std::string ToString() const
|
||||
{
|
||||
return strprintf("CBlockIndex(pprev=%p, nHeight=%d, merkle=%s, hashBlock=%s)",
|
||||
pprev, nHeight,
|
||||
hashMerkleRoot.ToString(),
|
||||
GetBlockHash().ToString());
|
||||
}
|
||||
std::string ToString() const;
|
||||
|
||||
//! Check whether this block index entry is valid up to the passed validity level.
|
||||
bool IsValid(enum BlockStatus nUpTo = BLOCK_VALID_TRANSACTIONS) const
|
||||
|
Loading…
Reference in New Issue
Block a user