diff options
author | Determinant <[email protected]> | 2020-08-20 12:09:32 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2020-08-20 12:09:32 -0400 |
commit | 726ad2214ca0a7e4d165838c531aa0d401524600 (patch) | |
tree | 1fb7a76d5caf01648525b864e94a3c720ee9a6ee /plugin/evm/block.go | |
parent | cb5e141d930e0c245804fe87a2caf4962b8f3c5f (diff) | |
parent | 0d2a35293b7aa49d143ce215591104aba1c89388 (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.go | 12 |
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 |