diff --git a/explorer/explorer.go b/explorer/explorer.go index 78f3499b..bf7cd592 100644 --- a/explorer/explorer.go +++ b/explorer/explorer.go @@ -24,10 +24,12 @@ func NewExplorer(s Store) *Explorer { return &Explorer{s: s} } +// Tip returns the tip of the best known valid chain. func (e *Explorer) Tip() (types.ChainIndex, error) { return e.s.Tip() } +// Block returns the block with the specified ID. func (e *Explorer) Block(id types.BlockID) (types.Block, error) { return e.s.Block(id) } diff --git a/persist/sqlite/txn.go b/persist/sqlite/txn.go index fba3b3f7..f091a6c8 100644 --- a/persist/sqlite/txn.go +++ b/persist/sqlite/txn.go @@ -75,9 +75,5 @@ func (s *Store) ProcessChainRevertUpdate(cru *chain.RevertUpdate) error { if err := s.applyUpdates(); err != nil { return err } - if err := s.deleteBlock(cru.Block.ID()); err != nil { - return err - } - - return nil + return s.deleteBlock(cru.Block.ID()) }