The wallet is async, so after generating a block, we must call syncwithvalidationinterfacequeue. Otherwise the timestamp will be of the previous block.
https://travis-ci.org/github/bitcoin/bitcoin/jobs/677685073#L2648
The wallet is async, so after generating a block, we must call syncwithvalidationinterfacequeue. Otherwise the timestamp will be of the previous block.
https://travis-ci.org/github/bitcoin/bitcoin/jobs/677685073#L2648
63 | @@ -63,6 +64,7 @@ def run_test(self): 64 | self.nodes[0].generate(1) 65 | self.nodes[1].generate(1) 66 | timestamp = self.nodes[1].getblock(self.nodes[1].getbestblockhash())['mediantime'] 67 | + self.nodes[1].syncwithvalidationinterfacequeue()
Just to make sure I understand correctly, what's the motivation for putting syncwithvalidationinterfacequeue after (instead of before) getting the timestamp value?
getbestblockhash directly accesses the chainstate, so it is not needed there.
The wallet only gets the chainstate async over the validationinterface, so it is needed there.
ACK fa8b9b5d1f48ad95eecf47ebbd7bf374777fc621.