diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-12-19 03:26:19 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-12-19 03:26:19 +0800 |
commit | dbbcf558e2c4ccb4556ba62d07204c25ddcb4783 (patch) | |
tree | c80eb767d4e4d38486688997318906e5396e5c93 /eth | |
parent | 4811409e99e87cd8862a9813422d61fc0f752d18 (diff) | |
parent | e6fb69296e647ff305e5d9df059e5aa956303538 (diff) | |
download | go-tangerine-dbbcf558e2c4ccb4556ba62d07204c25ddcb4783.tar go-tangerine-dbbcf558e2c4ccb4556ba62d07204c25ddcb4783.tar.gz go-tangerine-dbbcf558e2c4ccb4556ba62d07204c25ddcb4783.tar.bz2 go-tangerine-dbbcf558e2c4ccb4556ba62d07204c25ddcb4783.tar.lz go-tangerine-dbbcf558e2c4ccb4556ba62d07204c25ddcb4783.tar.xz go-tangerine-dbbcf558e2c4ccb4556ba62d07204c25ddcb4783.tar.zst go-tangerine-dbbcf558e2c4ccb4556ba62d07204c25ddcb4783.zip |
Merge pull request #2064 from fjl/remove-common-rlp
common: remove old RLP implementation, Value and ExtPackage
Diffstat (limited to 'eth')
-rw-r--r-- | eth/backend.go | 14 | ||||
-rw-r--r-- | eth/downloader/downloader_test.go | 7 |
2 files changed, 7 insertions, 14 deletions
diff --git a/eth/backend.go b/eth/backend.go index d51446d51..abd1214ca 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -180,12 +180,11 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) { } if !config.SkipBcVersionCheck { - b, _ := chainDb.Get([]byte("BlockchainVersion")) - bcVersion := int(common.NewValue(b).Uint()) + bcVersion := core.GetBlockChainVersion(chainDb) if bcVersion != config.BlockChainVersion && bcVersion != 0 { return nil, fmt.Errorf("Blockchain DB version mismatch (%d / %d). Run geth upgradedb.\n", bcVersion, config.BlockChainVersion) } - saveBlockchainVersion(chainDb, config.BlockChainVersion) + core.WriteBlockChainVersion(chainDb, config.BlockChainVersion) } glog.V(logger.Info).Infof("Blockchain DB Version: %d", config.BlockChainVersion) @@ -479,15 +478,6 @@ func dagFiles(epoch uint64) (string, string) { return dag, "full-R" + dag } -func saveBlockchainVersion(db ethdb.Database, bcVersion int) { - d, _ := db.Get([]byte("BlockchainVersion")) - blockchainVersion := common.NewValue(d).Uint() - - if blockchainVersion == 0 { - db.Put([]byte("BlockchainVersion"), common.NewValue(bcVersion).Bytes()) - } -} - // upgradeChainDatabase ensures that the chain database stores block split into // separate header and body entries. func upgradeChainDatabase(db ethdb.Database) error { diff --git a/eth/downloader/downloader_test.go b/eth/downloader/downloader_test.go index cfcc8a2ef..f02418a2f 100644 --- a/eth/downloader/downloader_test.go +++ b/eth/downloader/downloader_test.go @@ -61,8 +61,11 @@ func makeChain(n int, seed byte, parent *types.Block, parentReceipts types.Recei block.AddTx(tx) } // If the block number is a multiple of 5, add a bonus uncle to the block - if i%5 == 0 { - block.AddUncle(&types.Header{ParentHash: block.PrevBlock(i - 1).Hash(), Number: big.NewInt(int64(i - 1))}) + if i > 0 && i%5 == 0 { + block.AddUncle(&types.Header{ + ParentHash: block.PrevBlock(i - 1).Hash(), + Number: big.NewInt(block.Number().Int64() - 1), + }) } }) // Convert the block-chain into a hash-chain and header/block maps |