diff --git a/src/chain.h b/src/chain.h index 231113534ae..40ec115728e 100644 --- a/src/chain.h +++ b/src/chain.h @@ -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); } @@ -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; } @@ -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) @@ -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); diff --git a/src/init.cpp b/src/init.cpp index eafaac9d2d6..962a2009962 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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 diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 6bc6a996150..61713f1ee18 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -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", ""); result.pushKV("signblock_witness_hex", "");