diff options
author | Felix Lange <fjl@twurst.com> | 2015-12-11 08:33:45 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-12-18 19:09:10 +0800 |
commit | e6fb69296e647ff305e5d9df059e5aa956303538 (patch) | |
tree | 4af2d5237abf01ebe7ab35825266775aa7f76400 /core/database_util.go | |
parent | 1b89bd5d269d2d85a7c72067e18212135d8757f9 (diff) | |
download | go-tangerine-e6fb69296e647ff305e5d9df059e5aa956303538.tar.gz go-tangerine-e6fb69296e647ff305e5d9df059e5aa956303538.tar.zst go-tangerine-e6fb69296e647ff305e5d9df059e5aa956303538.zip |
common: remove old RLP implementation, Value and ExtPackage
In order to make this happen, kill all remaining trivial uses of
common/{rlp,value}.go. The non-trivial ones have been updated earlier.
Diffstat (limited to 'core/database_util.go')
-rw-r--r-- | core/database_util.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/database_util.go b/core/database_util.go index fbcce3e8c..2dc113e29 100644 --- a/core/database_util.go +++ b/core/database_util.go @@ -582,3 +582,17 @@ func GetMipmapBloom(db ethdb.Database, number, level uint64) types.Bloom { bloomDat, _ := db.Get(mipmapKey(number, level)) return types.BytesToBloom(bloomDat) } + +// GetBlockChainVersion reads the version number from db. +func GetBlockChainVersion(db ethdb.Database) int { + var vsn uint + enc, _ := db.Get([]byte("BlockchainVersion")) + rlp.DecodeBytes(enc, &vsn) + return int(vsn) +} + +// WriteBlockChainVersion writes vsn as the version number to db. +func WriteBlockChainVersion(db ethdb.Database, vsn int) { + enc, _ := rlp.EncodeToBytes(uint(vsn)) + db.Put([]byte("BlockchainVersion"), enc) +} |