diff options
author | gary rong <garyrong0905@gmail.com> | 2019-04-25 22:59:48 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2019-05-16 15:39:32 +0800 |
commit | 80469bea0cc6dbfae749d944094a7c2357dc050d (patch) | |
tree | fb70ce428df4a6b5b49dbd83cacca388555d51b5 /core/rawdb/table.go | |
parent | b6cac42e9ffc0b19a1e70416db85593f1cb0d30c (diff) | |
download | go-tangerine-80469bea0cc6dbfae749d944094a7c2357dc050d.tar go-tangerine-80469bea0cc6dbfae749d944094a7c2357dc050d.tar.gz go-tangerine-80469bea0cc6dbfae749d944094a7c2357dc050d.tar.bz2 go-tangerine-80469bea0cc6dbfae749d944094a7c2357dc050d.tar.lz go-tangerine-80469bea0cc6dbfae749d944094a7c2357dc050d.tar.xz go-tangerine-80469bea0cc6dbfae749d944094a7c2357dc050d.tar.zst go-tangerine-80469bea0cc6dbfae749d944094a7c2357dc050d.zip |
all: integrate the freezer with fast sync
* all: freezer style syncing
core, eth, les, light: clean up freezer relative APIs
core, eth, les, trie, ethdb, light: clean a bit
core, eth, les, light: add unit tests
core, light: rewrite setHead function
core, eth: fix downloader unit tests
core: add receipt chain insertion test
core: use constant instead of hardcoding table name
core: fix rollback
core: fix setHead
core/rawdb: remove canonical block first and then iterate side chain
core/rawdb, ethdb: add hasAncient interface
eth/downloader: calculate ancient limit via cht first
core, eth, ethdb: lots of fixes
* eth/downloader: print ancient disable log only for fast sync
Diffstat (limited to 'core/rawdb/table.go')
-rw-r--r-- | core/rawdb/table.go | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/core/rawdb/table.go b/core/rawdb/table.go index 0b5e08b20..124678959 100644 --- a/core/rawdb/table.go +++ b/core/rawdb/table.go @@ -50,12 +50,42 @@ func (t *table) Get(key []byte) ([]byte, error) { return t.db.Get(append([]byte(t.prefix), key...)) } +// HasAncient is a noop passthrough that just forwards the request to the underlying +// database. +func (t *table) HasAncient(kind string, number uint64) (bool, error) { + return t.db.HasAncient(kind, number) +} + // Ancient is a noop passthrough that just forwards the request to the underlying // database. func (t *table) Ancient(kind string, number uint64) ([]byte, error) { return t.db.Ancient(kind, number) } +// Ancients is a noop passthrough that just forwards the request to the underlying +// database. +func (t *table) Ancients() (uint64, error) { + return t.db.Ancients() +} + +// AppendAncient is a noop passthrough that just forwards the request to the underlying +// database. +func (t *table) AppendAncient(number uint64, hash, header, body, receipts, td []byte) error { + return t.db.AppendAncient(number, hash, header, body, receipts, td) +} + +// TruncateAncients is a noop passthrough that just forwards the request to the underlying +// database. +func (t *table) TruncateAncients(items uint64) error { + return t.db.TruncateAncients(items) +} + +// Sync is a noop passthrough that just forwards the request to the underlying +// database. +func (t *table) Sync() error { + return t.db.Sync() +} + // Put inserts the given value into the database at a prefixed version of the // provided key. func (t *table) Put(key []byte, value []byte) error { @@ -163,6 +193,6 @@ func (b *tableBatch) Reset() { } // Replay replays the batch contents. -func (b *tableBatch) Replay(w ethdb.Writer) error { +func (b *tableBatch) Replay(w ethdb.KeyValueWriter) error { return b.batch.Replay(w) } |