969 | @@ -970,6 +970,17 @@ class MinerImpl : public Mining
970 | BlockRef waitTipChanged(uint256 current_tip, MillisecondsDouble timeout) override
971 | {
972 | if (timeout > std::chrono::years{100}) timeout = std::chrono::years{100}; // Upper bound to avoid UB in std::chrono
973 | +
974 | + // Early return if the tip is already different.
975 | + {
976 | + LOCK(::cs_main);
977 | + const uint256 tip_hash{chainman().ActiveChain().Tip()->GetBlockHash()};
978 | + if (current_tip != uint256::ZERO || current_tip != tip_hash) {
435934fa020cec584b49c6151aa6b0d858054b37 oops, that should have been &&