diff --git a/bchain/coins/zec/zcashrpc.go b/bchain/coins/zec/zcashrpc.go index 6c9b023b..fa956f1e 100644 --- a/bchain/coins/zec/zcashrpc.go +++ b/bchain/coins/zec/zcashrpc.go @@ -80,7 +80,7 @@ func (z *ZCashRPC) GetBlock(hash string, height uint32) (*bchain.Block, error) { for _, txid := range res.Result.Txids { tx, err := z.GetTransaction(txid) if err != nil { - if isInvalidTx(err) { + if err == bchain.ErrTxNotFound { glog.Errorf("rpc: getblock: skipping transanction in block %s due error: %s", hash, err) continue } @@ -95,20 +95,6 @@ func (z *ZCashRPC) GetBlock(hash string, height uint32) (*bchain.Block, error) { return block, nil } -func isInvalidTx(err error) bool { - switch e1 := err.(type) { - case *errors.Err: - switch e2 := e1.Cause().(type) { - case *bchain.RPCError: - if e2.Code == -5 { // "No information available about transaction" - return true - } - } - } - - return false -} - // GetTransactionForMempool returns a transaction by the transaction ID. // It could be optimized for mempool, i.e. without block time and confirmations func (z *ZCashRPC) GetTransactionForMempool(txid string) (*bchain.Tx, error) {