mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
pgreco's startup crash fix
This commit is contained in:
parent
fba37b74b4
commit
29345e9e12
1 changed files with 4 additions and 0 deletions
|
|
@ -910,6 +910,10 @@ bool PeerManagerImpl::TipMayBeStale()
|
|||
|
||||
bool PeerManagerImpl::CanDirectFetch()
|
||||
{
|
||||
if(!m_chainman.ActiveChain().Tip()) {
|
||||
LogPrint(BCLog::NET, "Startup crash avoided\n");
|
||||
return false;
|
||||
}
|
||||
return m_chainman.ActiveChain().Tip()->GetBlockTime() > GetAdjustedTime() - m_chainparams.GetConsensus().nPowTargetSpacing * 20;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue