This adds an argument to waitforchange, where the caller may pass the best known block to them. Then, if the current state already is different from that, waitforchange will return immediately.
By making use of this feature, callers can avoid a potential race condition: If they call waitforchange but then a change happens between the client processing the result and calling waitforchange again, previously the call would block until another change was made. With this feature, clients can make sure they always get notified as soon as possible of any changes.
By passing an empty string for the new argument, callers can revert back to the old behaviour.
This adds an argument to
waitforchange
, where the caller may pass the best known block to them. Then, if the current state already is different from that, waitforchange will return immediately.By making use of this feature, callers can avoid a potential race condition: If they call
waitforchange
but then a change happens between the client processing the result and callingwaitforchange
again, previously the call would block until another change was made. With this feature, clients can make sure they always get notified as soon as possible of any changes.By passing an empty string for the new argument, callers can revert back to the old behaviour.