getNonce(function (err, nonce) { if (err != null) { return finished(err); } // Set the expected nonce, and update our caches of nonces. // Note that if our session nonce is lower than what we have cached // across all transactions (and not just this batch) use our cached // version instead, even if var final_nonce = Math.max(nonce, _this3.global_nonces[sender] || 0); // Update the transaction parameters. tx_params.nonce = Web3.prototype.toHex(final_nonce); // Update caches. session_nonces[sender] = final_nonce + 1; _this3.global_nonces[sender] = final_nonce + 1; // If our transaction signer does represent the address, // sign the transaction ourself and rewrite the payload. _this3.transaction_signer.signTransaction(tx_params, function (err, raw_tx) { if (err != null) { return next(err); } payload.method = "eth_sendRawTransaction"; payload.params = [raw_tx]; return next(); }); });
}, function (err, result) { if (err != null) { done(err); } else { var new_nonce = result.result; done(null, Web3.prototype.toDecimal(new_nonce)); } });