mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-03 17:30:25 +01:00
Merge bitcoin/bitcoin#31325: Make m_tip_block std::optional
81cea5d4eeEnsure m_tip_block is never ZERO (Sjors Provoost)e058544d0eMake m_tip_block an std::optional (Sjors Provoost) Pull request description: Suggested in https://github.com/bitcoin/bitcoin/pull/31297#discussion_r1844244309 ACKs for top commit: fjahr: re-ACK81cea5d4eetdb3: code review re ACK81cea5d4eel0rinc: ACK81cea5d4eeTree-SHA512: 31a75ba29e3d567bab32e4e7925a419d9d7a4d2d85ed1c1012116d8d22adc14d31d5b4ce5f6c499c994188dcd26a01cced05be74f94c892fc90ae17a6783a472
This commit is contained in:
@@ -971,7 +971,9 @@ public:
|
||||
{
|
||||
WAIT_LOCK(notifications().m_tip_block_mutex, lock);
|
||||
notifications().m_tip_block_cv.wait_for(lock, timeout, [&]() EXCLUSIVE_LOCKS_REQUIRED(notifications().m_tip_block_mutex) {
|
||||
return (notifications().m_tip_block != current_tip && notifications().m_tip_block != uint256::ZERO) || chainman().m_interrupt;
|
||||
// We need to wait for m_tip_block to be set AND for the value
|
||||
// to differ from the current_tip value.
|
||||
return (notifications().TipBlock() && notifications().TipBlock() != current_tip) || chainman().m_interrupt;
|
||||
});
|
||||
}
|
||||
// Must release m_tip_block_mutex before locking cs_main, to avoid deadlocks.
|
||||
|
||||
Reference in New Issue
Block a user