aboutsummaryrefslogtreecommitdiff
path: root/plugin/evm/vm.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/evm/vm.go')
-rw-r--r--plugin/evm/vm.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugin/evm/vm.go b/plugin/evm/vm.go
index 4fe4cc0..7a310bf 100644
--- a/plugin/evm/vm.go
+++ b/plugin/evm/vm.go
@@ -134,6 +134,7 @@ type VM struct {
genlock sync.Mutex
txSubmitChan <-chan struct{}
+ atomicTxSubmitChan chan struct{}
codec codec.Codec
clock timer.Clock
avaxAssetID ids.ID
@@ -211,6 +212,7 @@ func (vm *VM) Initialize(
case atx := <-vm.pendingAtomicTxs:
raw, _ := vm.codec.Marshal(atx)
block.SetExtraData(raw)
+ // TODO: make sure the atomic Tx is valid
}
return nil
})
@@ -313,6 +315,9 @@ func (vm *VM) Initialize(
case <-vm.txSubmitChan:
vm.ctx.Log.Verbo("New tx detected, trying to generate a block")
vm.tryBlockGen()
+ case <-vm.atomicTxSubmitChan:
+ vm.ctx.Log.Verbo("New atomic Tx detected, trying to generate a block")
+ vm.tryBlockGen()
case <-time.After(5 * time.Second):
vm.tryBlockGen()
}
@@ -628,6 +633,7 @@ func (vm *VM) FormatAddress(addr common.Address) (string, error) {
func (vm *VM) issueTx(tx *Tx) error {
select {
case vm.pendingAtomicTxs <- tx:
+ vm.atomicTxSubmitChan <- struct{}{}
default:
return errTooManyAtomicTx
}