mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
If Geth is engaged in a long-run block synchronization, such as a full syncing over a large number of blocks, invoking `debug_setHead` will cause `downloader.Cancel` to wait for all fetchers to stop first. This can be time-consuming, particularly for the block processing thread. To address this, we manually call `blockchain.StopInsert` to interrupt the blocking processing thread and allow it to exit immediately, and after that call `blockchain.ResumeInsert` to resume the block downloading process. Additionally, we add a sanity check for the input block number of `debug_setHead` to ensure its validity. --------- Signed-off-by: jsvisa <delweng@gmail.com> Co-authored-by: Gary Rong <garyrong0905@gmail.com> |
||
|---|---|---|
| .. | ||
| api.go | ||
| beacondevsync.go | ||
| beaconsync.go | ||
| downloader.go | ||
| downloader_test.go | ||
| events.go | ||
| fetchers.go | ||
| fetchers_concurrent.go | ||
| fetchers_concurrent_bodies.go | ||
| fetchers_concurrent_receipts.go | ||
| metrics.go | ||
| peer.go | ||
| queue.go | ||
| queue_test.go | ||
| resultstore.go | ||
| skeleton.go | ||
| skeleton_test.go | ||
| statesync.go | ||
| testchain_test.go | ||