j-berman d7c5f95704 p2p: fix race causing dropped connections during sync
Without this commit:
1) read height from DB
2) add block to chain in separate thread
3) read chain for block id's and request them from peer
4) ERR in handle_response_chain_entry, peer's first block is the
one that was added to the chain, which has block idx=height from
step 1.

This commit reads the chain for height and highest block id's
in one go while holding the m_blockchain_lock to avoid the race.
2025-12-11 21:36:42 -08:00
..
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2025-05-15 13:48:36 -05:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-12-23 10:41:09 -05:00
2024-05-21 16:29:33 +00:00
2024-07-16 19:01:09 -04:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-11-22 12:24:22 +01:00
2025-01-24 23:11:47 -08:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2025-02-28 00:40:29 +08:00
2024-05-21 16:29:33 +00:00
2025-11-11 10:43:39 -08:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-07-16 19:01:09 -04:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-05-21 16:29:33 +00:00
2024-07-16 18:42:49 -04:00
2024-05-21 16:29:33 +00:00