Call SyncWithValidationInterfaceQueue after RPCs
Summary:
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.
Test Plan:
- ninja check-functional
- All the build-* builds
- D13626, which relies on this diff
Reviewers: Fabien, #bitcoin_abc
Reviewed By: Fabien, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D13687