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
9393 *
9494 * @param[in] current_tip block hash of the current chain tip. Function waits
9595 * 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+ *
9798 * @returns Hash and height of the current chain tip after this call.
9899 */
99100 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
10721072
10731073 BlockRef waitTipChanged (uint256 current_tip, MillisecondsDouble timeout) override
10741074 {
1075+ Assume (timeout >= 0ms); // No internal callers should use a negative timeout
1076+ if (timeout < 0ms) timeout = 0ms;
10751077 if (timeout > std::chrono::years{100 }) timeout = std::chrono::years{100 }; // Upper bound to avoid UB in std::chrono
10761078 {
10771079 WAIT_LOCK (notifications ().m_tip_block_mutex , lock);
You can’t perform that action at this time.
0 commit comments