OSDN Git Service

add parallel fast sync support (#238)
authoryahtoo <yahtoo.ma@gmail.com>
Thu, 11 Jul 2019 06:04:09 +0000 (14:04 +0800)
committerPaladz <yzhu101@uottawa.ca>
Thu, 11 Jul 2019 06:04:09 +0000 (14:04 +0800)
commit068fc645e200e34e38a75dc283e3e4f05ab15d7f
treea9e8b211cb9884d4f6446dd9fbd4d5586a6defb3
parent51100c2a5afb320a9b16674f8c66b067fe760eb3
add parallel fast sync support (#238)

* Add parallel require blocks

* Add fast sync block storage and process

* add fetch blocks timeout process

* Fix oops bug

* add timeoutQueue func

* Fix review bug

* Opz code format

* modify parallelFetchHeaders function

* modify select sync peer logic

* Del unused code

* add blocksTasks struct

* Modify block parallel download mode

* Opz code format

* Fix test case error

* opz code format

* Add fast sync peer err handle

* Fix test case err

* Fix review bugs

* Fix review bugs

* Fix review bugs

* Add test file

* Fix review bug

* Fix fetch headers stopHeader lost err

* Fix locate headers bug

* Opz code format

* Fix review bug
16 files changed:
netsync/chainmgr/block_keeper.go
netsync/chainmgr/block_keeper_test.go
netsync/chainmgr/block_process.go [new file with mode: 0644]
netsync/chainmgr/block_process_test.go [new file with mode: 0644]
netsync/chainmgr/fast_sync.go
netsync/chainmgr/fast_sync_test.go
netsync/chainmgr/handle.go
netsync/chainmgr/msg_fetcher.go
netsync/chainmgr/peers.go [new file with mode: 0644]
netsync/chainmgr/storage.go [new file with mode: 0644]
netsync/chainmgr/storage_test.go [new file with mode: 0644]
netsync/chainmgr/tool_test.go
netsync/chainmgr/tx_keeper_test.go
netsync/peers/peer.go
netsync/sync_manager.go
node/node.go