OSDN Git Service

get BlockNode from database (#188)
authoroysheng <33340252+oysheng@users.noreply.github.com>
Tue, 25 Jun 2019 11:58:37 +0000 (19:58 +0800)
committerPaladz <yzhu101@uottawa.ca>
Tue, 25 Jun 2019 11:58:37 +0000 (19:58 +0800)
commit42c5ab23c13e7f43d0055221ec38752555bd987e
treec028b576a82d36d28e224a07852772640dc0e5b4
parentc25a6856e885c46a1086d0328d7fc528ca19086c
 get BlockNode from database (#188)

* modify BlockNode to database

* modify newBlockNode

* optimise LoadBlockIndex

* optimise hash

* restruct blockIndex

* delete redundancy function

* remove blockIndex BlockExist function and add Remove cached blockNode

* modify function name

* modify blockwitness index

* optimise

* optimise chain best node

* modify dir

* optimise

* delete blockindex

* optimise style

* remove argument

* modify name

* modify get blockwitness func

* add getBestNode

* optimise blockHashes

* remove BlockNode

* optimise struct

* optimise

* optimise protocol

* optimise saveChainStatus

* optimise

* optimise

* remove consensusNodeManager

* modify node to blockheader

* modify node name

* remove redundancy getBlocker

* modify node to blockHeader

* add lock

* add deep copy

* fix

* modify function name

* modify order

* optimise init getBlockHashes

* optimise

* modify database test

* fix validation test

* fix txpool test

* fix utxo_view test

* delete protocol block test

* optimise name and position

* optimise

* delete cond

* modify Name

* abstract common function

* optimise

* add unit test

* optimise unit test

* delete code

* save main chain hash by height

* save main chain hashes

* fix error

* optimise

* optimise

* optimsie

* optimise

* optimise
17 files changed:
database/cache.go
database/cache_test.go
database/store.go
database/store_test.go
protocol/bbft.go
protocol/block.go
protocol/block_test.go
protocol/consensus_node_manager.go
protocol/protocol.go
protocol/state/blockindex.go [deleted file]
protocol/state/blockindex_test.go [deleted file]
protocol/store.go
protocol/txpool_test.go
protocol/validation/block.go
protocol/validation/block_test.go
test/utxo_view/utxo_view_test.go
test/utxo_view/utxo_view_test_util.go