OSDN Git Service

Optimize p2p transfer business layer logic (#501)
authoryahtoo <yahtoo.ma@gmail.com>
Sat, 7 Apr 2018 08:05:35 +0000 (16:05 +0800)
committerPaladz <yzhu101@uottawa.ca>
Sat, 7 Apr 2018 08:05:35 +0000 (16:05 +0800)
commit58646e555f57145ece42762702c4defd2209ee86
tree97b5dc6d423e59ba34f70d88430cc58f276f5596
parentaffb9a1272633a069109264b6e25f1cb8328fced
Optimize p2p transfer business layer logic (#501)

* Optimize p2p business layer logic

* Merge dev branch code

* Fix new mined block can't broadcast error

* Remove unused test file

* Del unused parameter

* Add RWMutex

* Add sent message filter

* Fix request block quite bug

* Del unused function BroadcastToPeers

* Fix new peer channel bug

* Del chainHeight from blockKeeper

* Fix sync check logic bug

* Add business protocol handshake

* Del unused code

* Optimize code format

* Del unused function

* Refactor request block by hash/height function

* Refactor tx notify handle

* Refactor BlockRequestWorker to sequential process

* Fix net bestheight error

* Refactor p2p net sync code

* Refactor p2p net sync code

* Refactor BlockRequestWorker of blockkeeper

* ValidateTx return orphan flag

* For p2p transfer test

* For p2p transfer test

* Check exist block whether orphan

* Enable peer exchange function default

* Add txpool sync when new peer connected

* Fix golint check error

* Change mine difficulty

* Fix requst genesis block bug

* Fix address compare function

* Fix blockrequest bug

* Revert "For p2p transfer test"

This reverts commit e6a36d86d5077f6c520dbfbb6eee2ab4335012e5.

* Fix request block bug

* For test

* Fix code review problem

* Optimize log printing

* Fix ci check error
37 files changed:
api/api.go
api/block_retrieve.go [moved from api/blockchain_reactor.go with 92% similarity]
api/miner.go
api/nodeinfo.go [new file with mode: 0644]
api/query.go
api/txfeeds.go
blockchain/block_keeper.go [deleted file]
blockchain/blockchain_reactor.go [deleted file]
blockchain/miner.go [deleted file]
blockchain/reactor.go [deleted file]
blockchain/transact.go [deleted file]
blockchain/txbuilder/finalize.go
blockchain/txfeeds.go [deleted file]
cmd/bytomd/commands/run_node.go
cmd/miner/main.go
config/config.go
config/genesis.go
consensus/general.go
netsync/block_keeper.go [new file with mode: 0644]
netsync/fetcher.go [new file with mode: 0644]
netsync/handle.go [new file with mode: 0644]
netsync/message.go [moved from blockchain/net.go with 61% similarity]
netsync/peer.go [new file with mode: 0644]
netsync/protocol_reactor.go [new file with mode: 0644]
netsync/sync.go [new file with mode: 0644]
node/node.go
p2p/pex_reactor.go
p2p/switch.go
protocol/block.go
protocol/tx.go
vendor/gopkg.in/fatih/set.v0/LICENSE.md [new file with mode: 0644]
vendor/gopkg.in/fatih/set.v0/README.md [new file with mode: 0644]
vendor/gopkg.in/fatih/set.v0/set.go [new file with mode: 0644]
vendor/gopkg.in/fatih/set.v0/set_nots.go [new file with mode: 0644]
vendor/gopkg.in/fatih/set.v0/set_ts.go [new file with mode: 0644]
vendor/gopkg.in/karalabe/cookiejar.v2/collections/prque/prque.go [new file with mode: 0755]
vendor/gopkg.in/karalabe/cookiejar.v2/collections/prque/sstack.go [new file with mode: 0755]