core: move write caching layer into MemCacheStore
Simplify Blockchain and associated functions, deduplicate code, fix Get() and Seek() implementations.
This commit is contained in:
parent
4822c736bb
commit
fc0031e5aa
10 changed files with 283 additions and 197 deletions
|
@ -18,11 +18,11 @@ type interopContext struct {
|
|||
trigger byte
|
||||
block *Block
|
||||
tx *transaction.Transaction
|
||||
mem *storage.MemoryStore
|
||||
mem *storage.MemCachedStore
|
||||
}
|
||||
|
||||
func newInteropContext(trigger byte, bc Blockchainer, block *Block, tx *transaction.Transaction) *interopContext {
|
||||
mem := storage.NewMemoryStore()
|
||||
func newInteropContext(trigger byte, bc Blockchainer, s storage.Store, block *Block, tx *transaction.Transaction) *interopContext {
|
||||
mem := storage.NewMemCachedStore(s)
|
||||
return &interopContext{bc, trigger, block, tx, mem}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue