|
|
|
@ -50,6 +50,7 @@ class NonceTracker { |
|
|
|
|
await this._globalMutexFree() |
|
|
|
|
// await lock free, then take lock
|
|
|
|
|
const releaseLock = await this._takeMutex(address) |
|
|
|
|
try { |
|
|
|
|
// evaluate multiple nextNonce strategies
|
|
|
|
|
const nonceDetails = {} |
|
|
|
|
const networkNonceResult = await this._getNetworkNextNonce(address) |
|
|
|
@ -73,6 +74,11 @@ class NonceTracker { |
|
|
|
|
|
|
|
|
|
// return nonce and release cb
|
|
|
|
|
return { nextNonce, nonceDetails, releaseLock } |
|
|
|
|
} catch (err) { |
|
|
|
|
// release lock if we encounter an error
|
|
|
|
|
releaseLock() |
|
|
|
|
throw err |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async _globalMutexFree () { |
|
|
|
|