aboutsummaryrefslogtreecommitdiff
path: root/plugin/evm
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2020-09-18 13:11:39 -0400
committerDeterminant <[email protected]>2020-09-18 13:11:39 -0400
commit7d8c85cf8895b0f998d8eafb02f99d5b689fcd59 (patch)
tree1a7f65fcd72e77092525ab01625b8b9d365e3e40 /plugin/evm
parentaa4852662bcb45607a82ed115ac57d72a16b304b (diff)
parent3ea6a7940e40677b629270dfc7a1466bca295bd3 (diff)
Merge commit '3ea6a79' into dev
Diffstat (limited to 'plugin/evm')
-rw-r--r--plugin/evm/database.go10
-rw-r--r--plugin/evm/vm.go22
2 files changed, 10 insertions, 22 deletions
diff --git a/plugin/evm/database.go b/plugin/evm/database.go
index 81d1c1d..18890fa 100644
--- a/plugin/evm/database.go
+++ b/plugin/evm/database.go
@@ -46,16 +46,6 @@ func (db Database) Sync() error { return errOpNotSupported }
// NewBatch implements ethdb.Database
func (db Database) NewBatch() ethdb.Batch { return Batch{db.Database.NewBatch()} }
-//// NewIterator implements ethdb.Database
-//func (db Database) NewIterator() ethdb.Iterator {
-// return db.Database.NewIterator()
-//}
-
-//// NewIteratorWithPrefix implements ethdb.Database
-//func (db Database) NewIteratorWithPrefix(prefix []byte) ethdb.Iterator {
-// return db.NewIteratorWithPrefix(prefix)
-//}
-
// NewIterator implements ethdb.Database
func (db Database) NewIterator(prefix []byte, start []byte) ethdb.Iterator {
return db.NewIteratorWithStartAndPrefix(start, prefix)
diff --git a/plugin/evm/vm.go b/plugin/evm/vm.go
index c02b835..200a08d 100644
--- a/plugin/evm/vm.go
+++ b/plugin/evm/vm.go
@@ -154,14 +154,14 @@ func init() {
type VM struct {
ctx *snow.Context
- chainID *big.Int
- networkID uint64
- genesisHash common.Hash
- chain *coreth.ETHChain
- chaindb Database
- newBlockChan chan *Block
- networkChan chan<- commonEng.Message
- newTxPoolHeadChan *event.TypeMuxSubscription
+ chainID *big.Int
+ networkID uint64
+ genesisHash common.Hash
+ chain *coreth.ETHChain
+ chaindb Database
+ newBlockChan chan *Block
+ networkChan chan<- commonEng.Message
+ newMinedBlockSub *event.TypeMuxSubscription
acceptedDB database.Database
@@ -349,15 +349,13 @@ func (vm *VM) Initialize(
vm.bdTimerState = bdTimerStateLong
vm.bdGenWaitFlag = true
- //vm.newTxPoolHeadChan = make(chan core.NewTxPoolHeadEvent, 1)
vm.txPoolStabilizedOk = make(chan struct{}, 1)
vm.txPoolStabilizedShutdownChan = make(chan struct{}, 1) // Signal goroutine to shutdown
// TODO: read size from options
vm.pendingAtomicTxs = make(chan *Tx, 1024)
vm.atomicTxSubmitChan = make(chan struct{}, 1)
vm.shutdownSubmitChan = make(chan struct{}, 1)
- //chain.GetTxPool().SubscribeNewHeadEvent(vm.newTxPoolHeadChan)
- vm.newTxPoolHeadChan = vm.chain.SubscribeNewMinedBlockEvent()
+ vm.newMinedBlockSub = vm.chain.SubscribeNewMinedBlockEvent()
vm.shutdownWg.Add(1)
go ctx.Log.RecoverAndPanic(vm.awaitTxPoolStabilized)
chain.Start()
@@ -733,7 +731,7 @@ func (vm *VM) awaitTxPoolStabilized() {
defer vm.shutdownWg.Done()
for {
select {
- case e := <-vm.newTxPoolHeadChan.Chan():
+ case e := <-vm.newMinedBlockSub.Chan():
switch h := e.Data.(type) {
case core.NewMinedBlockEvent:
vm.txPoolStabilizedLock.Lock()