File tree 1 file changed +4
-6
lines changed
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ class Nf3 {
47
47
48
48
zkpKeys ;
49
49
50
- txsNotConfirmed = 0 ;
50
+ notConfirmed = 0 ;
51
51
52
52
defaultFee = DEFAULT_FEE ;
53
53
@@ -213,7 +213,6 @@ class Nf3 {
213
213
nonce : this . nonce ,
214
214
} ;
215
215
this . nonce ++ ;
216
- this . txsNotConfirmed ++ ;
217
216
} ) ;
218
217
219
218
if ( this . ethereumSigningKey ) {
@@ -223,11 +222,12 @@ class Nf3 {
223
222
// TODO does this still work if there is a chain reorg or do we have to handle that?
224
223
return new Promise ( ( resolve , reject ) => {
225
224
if ( process . env . VERBOSE ) console . log ( `Confirming transaction ${ signed . transactionHash } ` ) ;
225
+ this . notConfirmed ++ ;
226
226
this . web3 . eth
227
227
. sendSignedTransaction ( signed . rawTransaction )
228
228
. on ( 'confirmation' , ( number , receipt ) => {
229
229
if ( number === 12 ) {
230
- this . txsNotConfirmed -- ;
230
+ this . notConfirmed -- ;
231
231
if ( process . env . VERBOSE )
232
232
console . log (
233
233
`Transaction ${ receipt . transactionHash } has been confirmed ${ number } times.` ,
@@ -237,13 +237,11 @@ class Nf3 {
237
237
}
238
238
} )
239
239
. on ( 'error' , err => {
240
- this . txsNotConfirmed -- ;
241
- if ( err . message . includes ( 'nonce' ) ) this . nonce -- ;
240
+ this . notConfirmed -- ;
242
241
reject ( err ) ;
243
242
} ) ;
244
243
} ) ;
245
244
}
246
- this . txsNotConfirmed -- ;
247
245
// TODO add wait for confirmations to the wallet functionality
248
246
return this . web3 . eth . sendTransaction ( tx ) ;
249
247
}
You can’t perform that action at this time.
0 commit comments