RPCs that update the chain state now wait for the (async) CValidationInterface queue to finish.
The following RPCs will call SyncWithValidationInterfaceQueue before returning:
- preciousblock
- invalidateblock
- parkblock
- reconsiderblock
- unparkblock
- generatetodescriptor
- generatetoaddress
- generateblock
- submitblock
- sendrawtransaction
This is more in line with the expected behavior, after a user e.g. called sendrawtransaction, it's reasonable to expect the wallet/indexers to always have this tx indexed after the call returned.
While users could use syncwithvalidationinterfacequeue, to enforce this, it requires discipline, because usually after the call returned, the indexers caught up already, so only occasionally a call to syncwithvalidationinterfacequeue is actually necessary. This would make software using the node more brittle.
This diff makes it so that users of these RPCs don't have to wait for the queue to clear manually.