207 | @@ -208,10 +208,9 @@ def str_to_b64str(string):
208 | def satoshi_round(amount):
209 | return Decimal(amount).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN)
210 |
211 | -def wait_until(predicate, *, attempts=float('inf'), timeout=float('inf'), lock=None, timeout_factor=1.0):
212 | +def wait_until(predicate, *, attempts=float('inf'), timeout=float('inf'), lock=None):
Mininode has its own wait_until function which automatically grabs the mininode_lock (in addition to including the mininode's timeout_factor) so I think it’s probably better to use that function if synchronization is needed.
Would it be worth adding a comment about this? I’ve seen multiple reviews with reminders to pass in the mininode_lock or use another function that does it automatically. I wonder if a comment would help remind people earlier on.
Thank @gzhao408 for the review and testing. While I agree with the cautionary message of using the mininode wait_until, I am not sure whether this is the correct place to add that comment. This seems like a generalized function for wait_until that can be used in many places and not all of them might require the lock.
It seems that comment can be placed in the mininode's definition itself as a reminder to use mininode.wait_until whenever required as opposed to util.wait_until.
Well, no, my suggestion for the comment is more of a "don't use this."
I don't think util.wait_until should ever be used except to define object-specific wait_until since they should be responsible for including the timeout_factor (that's the point of this PR right?). In functional tests, I think it's more appropriate to use mininode, test_node, or test_framework wait_until. See #19134 - your PRs are very intertwined.
Hmm I see your point now, a comment here saying "Dont Use it" can help as per #19134 modifications. I am also now confused about why there are so many wait_untils to begin with. Anyway, I am not very sure if this PR is adding any value. timeout_factor is not being used anywhere with wait_until anyway. I think I will wait for more ACKs before further working on this.