aboutsummaryrefslogtreecommitdiff
path: root/plugin/evm/block.go
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2020-08-20 12:09:32 -0400
committerDeterminant <[email protected]>2020-08-20 12:09:32 -0400
commit726ad2214ca0a7e4d165838c531aa0d401524600 (patch)
tree1fb7a76d5caf01648525b864e94a3c720ee9a6ee /plugin/evm/block.go
parentcb5e141d930e0c245804fe87a2caf4962b8f3c5f (diff)
parent0d2a35293b7aa49d143ce215591104aba1c89388 (diff)
Merge tag 'v0.2.8-rc.6' into ecstasy-transferv0.2.12
Diffstat (limited to 'plugin/evm/block.go')
-rw-r--r--plugin/evm/block.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugin/evm/block.go b/plugin/evm/block.go
index 0779e17..375dc6d 100644
--- a/plugin/evm/block.go
+++ b/plugin/evm/block.go
@@ -13,6 +13,7 @@ import (
"github.com/ava-labs/gecko/ids"
"github.com/ava-labs/gecko/snow/choices"
"github.com/ava-labs/gecko/snow/consensus/snowman"
+ "github.com/ava-labs/gecko/vms/components/missing"
)
// Block implements the snowman.Block interface
@@ -63,13 +64,12 @@ func (b *Block) Status() choices.Status {
// Parent implements the snowman.Block interface
func (b *Block) Parent() snowman.Block {
parentID := ids.NewID(b.ethBlock.ParentHash())
- block := &Block{
- id: parentID,
- ethBlock: b.vm.getCachedBlock(parentID),
- vm: b.vm,
+ if block := b.vm.getBlock(parentID); block != nil {
+ b.vm.ctx.Log.Verbo("Parent(%s) has status: %s", parentID, block.Status())
+ return block
}
- b.vm.ctx.Log.Verbo("Parent(%s) has status: %s", block.ID(), block.Status())
- return block
+ b.vm.ctx.Log.Verbo("Parent(%s) has status: %s", parentID, choices.Unknown)
+ return &missing.Block{BlkID: parentID}
}
// Verify implements the snowman.Block interface