Wait to be able to query transactions from the mempool.
This commit is contained in:
parent
b738a5fb84
commit
8c8aa7dba2
@ -193,13 +193,25 @@ async_blocks_ready(uv_work_t *req) {
|
|||||||
CBlockIndex* tip = chainActive.Tip();
|
CBlockIndex* tip = chainActive.Tip();
|
||||||
uint256 tipHash = tip->GetBlockHash();
|
uint256 tipHash = tip->GetBlockHash();
|
||||||
|
|
||||||
|
// Wait to be able to query for blocks by hash
|
||||||
while(mapBlockIndex.count(tipHash) == 0) {
|
while(mapBlockIndex.count(tipHash) == 0) {
|
||||||
usleep(1E6);
|
usleep(1E6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wait for chainActive to be able to get the hash
|
||||||
|
// for the genesis block for querying blocks by height
|
||||||
while(chainActive[0] == NULL) {
|
while(chainActive[0] == NULL) {
|
||||||
usleep(1E6);
|
usleep(1E6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wait until we can get a lock on cs_main
|
||||||
|
// And therefore ready to be able to quickly
|
||||||
|
// query for transactions from the mempool.
|
||||||
|
LOCK(cs_main);
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user