diff --git a/utxorpc/sync.go b/utxorpc/sync.go index da890072..0bab1da4 100644 --- a/utxorpc/sync.go +++ b/utxorpc/sync.go @@ -230,16 +230,7 @@ func (s *syncServiceServer) FollowTip( } if next != nil { // Send block response - blockBytes := next.Block.Cbor - blockType, err := ledger.DetermineBlockType(blockBytes) - if err != nil { - s.utxorpc.config.Logger.Error( - "failed to get block type", - "error", err, - ) - return err - } - block, err := ledger.NewBlockFromCbor(blockType, blockBytes) + block, err := ledger.NewBlockFromCbor(next.Block.Type, next.Block.Cbor) if err != nil { s.utxorpc.config.Logger.Error( "failed to get block", diff --git a/utxorpc/watch.go b/utxorpc/watch.go index 4ef945ae..047c3b71 100644 --- a/utxorpc/watch.go +++ b/utxorpc/watch.go @@ -109,16 +109,7 @@ func (s *watchServiceServer) WatchTx( } if next != nil { // Get ledger.Block from bytes - blockBytes := next.Block.Cbor - blockType, err := ledger.DetermineBlockType(blockBytes) - if err != nil { - s.utxorpc.config.Logger.Error( - "failed to get block type", - "error", err, - ) - return err - } - block, err := ledger.NewBlockFromCbor(blockType, blockBytes) + block, err := ledger.NewBlockFromCbor(next.Block.Type, next.Block.Cbor) if err != nil { s.utxorpc.config.Logger.Error( "failed to get block",