Skip to content

Commit c1ab47d

Browse files
committed
Remove redundant initial transaction check in PollForTransaction, directly calling WaitTransactionByHash
1 parent 5eab960 commit c1ab47d

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

nodeClient.go

+1-10
Original file line numberDiff line numberDiff line change
@@ -328,17 +328,8 @@ func getTransactionPollOptions(defaultPeriod, defaultTimeout time.Duration, opti
328328
// Accepts options PollPeriod and PollTimeout which should wrap time.Duration values.
329329
// Not just a degenerate case of PollForTransactions, it may return additional information for the single transaction polled.
330330
func (rc *NodeClient) PollForTransaction(hash string, options ...any) (*api.UserTransaction, error) {
331-
// Check if the transaction is already done
332-
txn, err := rc.TransactionByHash(hash)
333-
if err != nil {
334-
return nil, err
335-
}
336-
if txn.Type == api.TransactionVariantUser {
337-
return txn.UserTransaction()
338-
}
339-
340331
// Wait for the transaction to be done
341-
txn, err = rc.WaitTransactionByHash(hash)
332+
txn, err := rc.WaitTransactionByHash(hash)
342333
if err != nil {
343334
return nil, err
344335
}

0 commit comments

Comments
 (0)