mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
fix: validation: cast now() to seconds for maxtipage comparison
Since faf44876db
, the maxtipage comparison
in IsInitialBlockDownload() has been broken, since the NodeClock::now()
time_point is in the system's native denomination (micrcoseconds).
Without this patch, specifying the maximum allowable -maxtipage
(9223372036854775807) results in a SIGABRT crash.
Co-authored-by: MacroFake <falke.marco@gmail.com>
This commit is contained in:
parent
48174c0f28
commit
a451e832b4
1 changed files with 1 additions and 1 deletions
|
@ -1541,7 +1541,7 @@ bool Chainstate::IsInitialBlockDownload() const
|
|||
if (m_chain.Tip()->nChainWork < m_chainman.MinimumChainWork()) {
|
||||
return true;
|
||||
}
|
||||
if (m_chain.Tip()->Time() < NodeClock::now() - m_chainman.m_options.max_tip_age) {
|
||||
if (m_chain.Tip()->Time() < Now<NodeSeconds>() - m_chainman.m_options.max_tip_age) {
|
||||
return true;
|
||||
}
|
||||
LogPrintf("Leaving InitialBlockDownload (latching to false)\n");
|
||||
|
|
Loading…
Add table
Reference in a new issue