We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f2694e4 commit a91b77bCopy full SHA for a91b77b
1 file changed
api/cmt.go
@@ -191,12 +191,13 @@ func (s *CmtRPCService) GetTransactionByHash(hash string) (*RPCTransaction, erro
191
}
192
// get transaction
193
res, err := s.backend.GetLocalClient().Tx(bkey, false)
194
- errNotFound := fmt.Errorf("Tx (%X) not found", hash)
195
- if err != nil && err != errNotFound {
+ if err == nil {
+ return newRPCTransaction(res)
196
+ }
197
+ errNotFound := fmt.Sprintf("Tx (%X) not found", bkey)
198
+ if err != nil && err.Error() != errNotFound {
199
// error other than not found
200
return nil, err
- } else {
- return newRPCTransaction(res)
201
202
// No finalized transaction, try to retrieve it from the pool
203
unConfirmedTxs, err := core.UnconfirmedTxs(-1)
0 commit comments