OSDN Git Service

Add block fast sync function (#1104)
authoryahtoo <yahtoo.ma@gmail.com>
Thu, 19 Jul 2018 11:09:05 +0000 (19:09 +0800)
committerPaladz <yzhu101@uottawa.ca>
Thu, 19 Jul 2018 11:09:05 +0000 (19:09 +0800)
commitd4d2b7110db72f6d32438e55e41821034ffac99d
treec290050e39b7ef52a60d26f28c3865007b7f09de
parentddf02914ed1d1af1848a21d49141d13eacc40115
Add block fast sync function (#1104)

* Add block headers handler for fast sync

* Add testnet checkpoint

* Add debug info

* Fix GetHeadersMessage bug

* Add debug info

* Fix HeadersMessage bug

* Add HeadersMessage handler

* Fast sync call BlockRequestWorker download block

* Add debug info for measure time

* Add getBlocks for fast sync

* Fix code logic errors

* Del unused variable headersFirstMode

* Fix hash string compare error

* Fix code logic errors

* Fix blocksSend logic error

* Optimize log printing

* Add max blocksMsg package size limit

* Modify fast sync node selection logic

* Fix multi checkpoint fast sync error

* Del unused code prevGetHdrsMtx

* Add fast sync txs merkle root check

* Add fast sync complete new status broadcast

* Change variable hash format

* edit the code format

* delete the unused checkpoint

* edit netsync message byte

* Fix Duplicate Byte BlockRequestMessage

* Add testnet checkpoint

* tmp save

* edit the handle logic

* edit the fast sync

* move tx process out of blockKeeper

* elegant the message

* elegant the peer.go

* elegant block_keeper

* elegant the block_fetcher

* fix api node info bug

* delete unused data

* edit the tx_keeper

* edit ban method

* make sure both size sync tx

* add response bool on every send

* handle all the peer dc

* merge with dev

* fix bug on merge with dev

* add max block peer msg limit

* limit the max send block size

* fix the web wallet display bug

* fix hand shake timepout error

* fix logic if statement

* edit the services flag bug

* add error message log

* edit blocks/headers, marshal/unmarshal

* edit the message field name

* fix sync logic bug

* fix sync bug

* fix a code logic error
19 files changed:
api/nodeinfo.go
common/types.go
consensus/general.go
mining/mining.go
mining/sort.go
mining/tensority/algorithm.go
netsync/block_fetcher.go [new file with mode: 0644]
netsync/block_keeper.go
netsync/fetcher.go [deleted file]
netsync/handle.go
netsync/message.go
netsync/peer.go
netsync/protocol_reactor.go
netsync/sync.go [deleted file]
netsync/tx_keeper.go [new file with mode: 0644]
p2p/peer.go
p2p/pex/pex_reactor.go
p2p/switch.go
protocol/block.go