Skip to content

Commit 2184fbd

Browse files
chris124567ChrisSchinnerl
authored andcommitted
ignore if there is unmarshaling error
1 parent 8c1613b commit 2184fbd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

explorer/explorer.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -655,12 +655,12 @@ func (e *Explorer) Search(id string) (SearchType, error) {
655655

656656
// check unconfirmed transaction pool
657657
var txnID types.TransactionID
658-
if err := txnID.UnmarshalText([]byte(id)); err != nil {
659-
return SearchTypeInvalid, err
660-
} else if _, ok := e.UnconfirmedTransaction(txnID); ok {
661-
return SearchTypeTransaction, nil
662-
} else if _, ok := e.UnconfirmedV2Transaction(txnID); ok {
663-
return SearchTypeV2Transaction, nil
658+
if err := txnID.UnmarshalText([]byte(id)); err == nil {
659+
if _, ok := e.UnconfirmedTransaction(txnID); ok {
660+
return SearchTypeTransaction, nil
661+
} else if _, ok := e.UnconfirmedV2Transaction(txnID); ok {
662+
return SearchTypeV2Transaction, nil
663+
}
664664
}
665665
return SearchTypeInvalid, ErrNoSearchResults
666666
}

0 commit comments

Comments
 (0)