Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/chain.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,11 @@ class CBlockIndex
m_signblock_witness = std::nullopt;
}

bool trimmed() const {
inline bool trimmed() const {
return m_trimmed;
}

void assert_untrimmed() const {
inline void assert_untrimmed() const {
assert(!m_trimmed);
}

Expand All @@ -230,7 +230,7 @@ class CBlockIndex
return proof.value();
}

const bool dynafed_block() const {
bool is_dynafed_block() const {
if (m_trimmed) {
return m_trimmed_dynafed_block;
}
Expand Down Expand Up @@ -417,12 +417,12 @@ class CDiskBlockIndex : public CBlockIndex
nVersion = ~CBlockHeader::DYNAFED_HF_MASK & nVersion;
return is_dyna;
} else {
return !dynafed_params().IsNull();
return is_dynafed_block();
}
}
bool RemoveDynaFedMaskOnSerialize(bool for_read) const {
assert(!for_read);
return !dynafed_params().IsNull();
return is_dynafed_block();
}

SERIALIZE_METHODS(CDiskBlockIndex, obj)
Expand All @@ -445,12 +445,12 @@ class CDiskBlockIndex : public CBlockIndex
READWRITE(obj.nVersion);
} else {
int32_t nVersion = obj.nVersion;
if (!obj.dynafed_params().IsNull()) {
if (obj.is_dynafed_block()) {
nVersion |= CBlockHeader::DYNAFED_HF_MASK;
}
READWRITE(nVersion);
}
bool is_dyna = obj.RemoveDynaFedMaskOnSerialize(ser_action.ForRead());;
bool is_dyna = obj.RemoveDynaFedMaskOnSerialize(ser_action.ForRead());

READWRITE(obj.hashPrev);
READWRITE(obj.hashMerkleRoot);
Expand Down
2 changes: 1 addition & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ bool AppInitParameterInteraction(const ArgsManager& args)
epoch_length = 20160;
}

if (args.IsArgSet("-trim_headers")) {
if (args.GetBoolArg("-trim_headers", false)) {
LogPrintf("Configured for header-trimming mode. This will reduce memory usage substantially, but we will be unable to serve as a full P2P peer, and certain header fields may be missing from JSON RPC output.\n");
fTrimHeaders = true;
// This calculation is driven by GetValidFedpegScripts in pegins.cpp, which walks the chain
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ UniValue blockheaderToJSON(const CBlockIndex* tip, const CBlockIndex* blockindex
result.pushKV("difficulty", GetDifficulty(blockindex));
result.pushKV("chainwork", blockindex->nChainWork.GetHex());
} else {
if (!blockindex->dynafed_block()) {
if (!blockindex->is_dynafed_block()) {
if (blockindex->trimmed()) {
result.pushKV("signblock_witness_asm", "<trimmed>");
result.pushKV("signblock_witness_hex", "<trimmed>");
Expand Down