mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
Allow untrimming headers when needed
This commit is contained in:
parent
4259278ff5
commit
c28c5ce619
5 changed files with 40 additions and 0 deletions
|
|
@ -56,6 +56,20 @@ CBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const {
|
|||
return CBlockLocator(vHave);
|
||||
}
|
||||
|
||||
void CBlockIndex::untrim() {
|
||||
if (!trimmed())
|
||||
return;
|
||||
CBlockIndex tmp;
|
||||
const CBlockIndex *pindexfull = untrim_to(&tmp);
|
||||
assert(pindexfull!=this);
|
||||
m_trimmed = false;
|
||||
set_stored();
|
||||
proof = pindexfull->proof;
|
||||
m_dynafed_params = pindexfull->m_dynafed_params;
|
||||
m_signblock_witness = pindexfull->m_signblock_witness;
|
||||
m_pcontext->chainman->m_blockman.m_dirty_blockindex.insert(this);
|
||||
}
|
||||
|
||||
const CBlockIndex *CBlockIndex::untrim_to(CBlockIndex *pindexNew) const
|
||||
{
|
||||
return m_pcontext->chainman->m_blockman.m_block_tree_db->RegenerateFullIndex(this, pindexNew);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue