Skip to content

Commit 8959da1

Browse files
committed
fix: restore nonConfirmed version
1 parent b51d56d commit 8959da1

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

‎cli/lib/nf3.mjs

+4-6
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Nf3 {
4747

4848
zkpKeys;
4949

50-
txsNotConfirmed = 0;
50+
notConfirmed = 0;
5151

5252
defaultFee = DEFAULT_FEE;
5353

@@ -213,7 +213,6 @@ class Nf3 {
213213
nonce: this.nonce,
214214
};
215215
this.nonce++;
216-
this.txsNotConfirmed++;
217216
});
218217

219218
if (this.ethereumSigningKey) {
@@ -223,11 +222,12 @@ class Nf3 {
223222
// TODO does this still work if there is a chain reorg or do we have to handle that?
224223
return new Promise((resolve, reject) => {
225224
if (process.env.VERBOSE) console.log(`Confirming transaction ${signed.transactionHash}`);
225+
this.notConfirmed++;
226226
this.web3.eth
227227
.sendSignedTransaction(signed.rawTransaction)
228228
.on('confirmation', (number, receipt) => {
229229
if (number === 12) {
230-
this.txsNotConfirmed--;
230+
this.notConfirmed--;
231231
if (process.env.VERBOSE)
232232
console.log(
233233
`Transaction ${receipt.transactionHash} has been confirmed ${number} times.`,
@@ -237,13 +237,11 @@ class Nf3 {
237237
}
238238
})
239239
.on('error', err => {
240-
this.txsNotConfirmed--;
241-
if (err.message.includes('nonce')) this.nonce--;
240+
this.notConfirmed--;
242241
reject(err);
243242
});
244243
});
245244
}
246-
this.txsNotConfirmed--;
247245
// TODO add wait for confirmations to the wallet functionality
248246
return this.web3.eth.sendTransaction(tx);
249247
}

0 commit comments

Comments
 (0)