diff --git a/core/rawdb/accessors_chain.go b/core/rawdb/accessors_chain.go index 2f37cb051..320886c91 100644 --- a/core/rawdb/accessors_chain.go +++ b/core/rawdb/accessors_chain.go @@ -751,7 +751,7 @@ func FindCommonAncestor(db ethdb.Reader, a, b *types.WorkObject, nodeCtx int) (* for bn := b.NumberU64(nodeCtx); a.NumberU64(nodeCtx) > bn; { a = ReadHeader(db, a.NumberU64(nodeCtx)-1, a.ParentHash(nodeCtx)) if IsGenesisHash(db, a.ParentHash(nodeCtx)) { - return nil, fmt.Errorf("no common ancestor found") + return a, nil } if a == nil { return nil, fmt.Errorf("unable to find hash %s", a.ParentHash(nodeCtx).String()) @@ -760,7 +760,7 @@ func FindCommonAncestor(db ethdb.Reader, a, b *types.WorkObject, nodeCtx int) (* for an := a.NumberU64(nodeCtx); an < b.NumberU64(nodeCtx); { b = ReadHeader(db, b.NumberU64(nodeCtx)-1, b.ParentHash(nodeCtx)) if IsGenesisHash(db, b.ParentHash(nodeCtx)) { - return nil, fmt.Errorf("no common ancestor found") + return b, nil } if b == nil { return nil, fmt.Errorf("unable to find hash %s", b.ParentHash(nodeCtx).String())