@@ -98,7 +98,9 @@ export default class EthereumSwapProvider extends Provider {
9898
9999 async verifyInitiateSwapTransaction ( initiationTxHash , value , recipientAddress , refundAddress , secretHash , expiration ) {
100100 const initiationTransaction = await this . getMethod ( 'getTransactionByHash' ) ( initiationTxHash )
101- return this . doesTransactionMatchSwapParams ( initiationTransaction , value , recipientAddress , refundAddress , secretHash , expiration )
101+ const initiationTransactionReceipt = await this . getMethod ( 'getTransactionReceipt' ) ( initiationTxHash )
102+ const transactionMatchesSwapParams = this . doesTransactionMatchSwapParams ( initiationTransaction , value , recipientAddress , refundAddress , secretHash , expiration )
103+ return transactionMatchesSwapParams && initiationTransactionReceipt . status === '1'
102104 }
103105
104106 async findInitiateSwapTransaction ( value , recipientAddress , refundAddress , secretHash , expiration ) {
@@ -107,13 +109,9 @@ export default class EthereumSwapProvider extends Provider {
107109 while ( ! initiateSwapTransaction ) {
108110 const block = await this . getMethod ( 'getBlockByNumber' ) ( blockNumber , true )
109111 if ( block ) {
110- const transaction = block . transactions . find ( transaction =>
112+ initiateSwapTransaction = block . transactions . find ( transaction =>
111113 this . doesTransactionMatchSwapParams ( transaction , value , recipientAddress , refundAddress , secretHash , expiration )
112114 )
113- if ( transaction ) {
114- const transactionReceipt = await this . getMethod ( 'getTransactionReceipt' ) ( transaction . hash )
115- if ( transactionReceipt . status === '1' ) initiateSwapTransaction = transaction
116- }
117115 blockNumber ++
118116 }
119117 await sleep ( 5000 )
0 commit comments