Skip to content

Commit

Permalink
Take anchor block deeper to avoid "Anchor too new" error
Browse files Browse the repository at this point in the history
  • Loading branch information
Bushstar committed Jun 14, 2021
1 parent 8e6cdc7 commit 9e24365
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4738,7 +4738,8 @@ void ProcessAuthsIfTipChanged(CBlockIndex const * oldTip, CBlockIndex const * ti
int anchorHeight = static_cast<int>(pindex->height) - consensus.mn.anchoringFrequency;

// Get anchor block from specified time depth
while (anchorHeight > 0 && ::ChainActive()[anchorHeight]->nTime + consensus.mn.anchoringTimeDepth > pindex->nTime) {
int64_t timeDepth = consensus.mn.anchoringTimeDepth + (consensus.mn.anchoringTeamChange * consensus.pos.nTargetSpacing);
while (anchorHeight > 0 && ::ChainActive()[anchorHeight]->nTime + timeDepth > pindex->nTime) {
--anchorHeight;
}

Expand Down

0 comments on commit 9e24365

Please sign in to comment.