From b411ce881ef3ad6c2e04b48b3ca50555d42f554d Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Sun, 20 Jan 2019 12:22:49 +0100 Subject: [PATCH] Fix Groestlcoin rpc --- bchain/coins/grs/grsrpc.go | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/bchain/coins/grs/grsrpc.go b/bchain/coins/grs/grsrpc.go index f7adebd0..d3afb9f0 100644 --- a/bchain/coins/grs/grsrpc.go +++ b/bchain/coins/grs/grsrpc.go @@ -79,7 +79,7 @@ func (g *GroestlcoinRPC) GetBlock(hash string, height uint32) (*bchain.Block, er for _, txid := range res.Result.Txids { tx, err := g.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 } @@ -94,20 +94,6 @@ func (g *GroestlcoinRPC) GetBlock(hash string, height uint32) (*bchain.Block, er 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 (g *GroestlcoinRPC) GetTransactionForMempool(txid string) (*bchain.Tx, error) {