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> |
||
|---|---|---|
| .. | ||
| override | ||
| testdata | ||
| addrlock.go | ||
| api.go | ||
| api_test.go | ||
| backend.go | ||
| dbapi.go | ||
| errors.go | ||
| logtracer.go | ||
| simulate.go | ||
| simulate_test.go | ||
| transaction_args.go | ||
| transaction_args_test.go | ||