File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,8 @@ class Mining
93
93
*
94
94
* @param[in] current_tip block hash of the current chain tip. Function waits
95
95
* for the chain tip to differ from this.
96
- * @param[in] timeout how long to wait for a new tip
96
+ * @param[in] timeout how long to wait for a new tip (default is forever)
97
+ *
97
98
* @returns Hash and height of the current chain tip after this call.
98
99
*/
99
100
virtual BlockRef waitTipChanged (uint256 current_tip, MillisecondsDouble timeout = MillisecondsDouble::max()) = 0;
Original file line number Diff line number Diff line change @@ -1072,6 +1072,8 @@ class MinerImpl : public Mining
1072
1072
1073
1073
BlockRef waitTipChanged (uint256 current_tip, MillisecondsDouble timeout) override
1074
1074
{
1075
+ Assume (timeout >= 0ms); // No internal callers should use a negative timeout
1076
+ if (timeout < 0ms) timeout = 0ms;
1075
1077
if (timeout > std::chrono::years{100 }) timeout = std::chrono::years{100 }; // Upper bound to avoid UB in std::chrono
1076
1078
{
1077
1079
WAIT_LOCK (notifications ().m_tip_block_mutex , lock);
You can’t perform that action at this time.
0 commit comments