MCPcopy Create free account
hub / github.com/ElementsProject/elements / trim

Method trim

src/chain.h:232–244  ·  view source on GitHub ↗

Irrevocably remove blocksigning and dynafed-related stuff from this in-memory copy of the block header.

Source from the content-addressed store, hash-verified

230 // Irrevocably remove blocksigning and dynafed-related stuff from this
231 // in-memory copy of the block header.
232 bool trim() {
233 assert_untrimmed();
234 if (!m_stored_lvl) {
235 // We can't trim in-memory data if it's not on disk yet, but we can if it's already been recovered once
236 return false;
237 }
238 m_trimmed = true;
239 m_trimmed_dynafed_block = !m_dynafed_params.value().IsNull();
240 proof = std::nullopt;
241 m_dynafed_params = std::nullopt;
242 m_signblock_witness = std::nullopt;
243 return true;
244 }
245
246 void untrim();
247 const CBlockIndex * untrim_to(CBlockIndex *pindexNew) const;

Callers 2

LoadBlockIndexGutsMethod · 0.80
FlushStateToDiskMethod · 0.80

Calls 2

IsNullMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected