From 6848a954576d8017cc85d52c172a26d583eb1f18 Mon Sep 17 00:00:00 2001 From: Alex Rea Date: Tue, 14 Aug 2018 14:59:08 +0100 Subject: [PATCH] Try out a fix --- lib/statemanager.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/statemanager.js b/lib/statemanager.js index 19b18c6d9b..6e223852f4 100644 --- a/lib/statemanager.js +++ b/lib/statemanager.js @@ -564,7 +564,7 @@ StateManager.prototype.processBlocks = function(total_blocks, callback) { StateManager.prototype.processCall = function (from, rawTx, blockNumber, callback) { var self = this; - self.createFakeTransactionWithCorrectNonce(rawTx, from, function(err, tx) { + self.createFakeTransactionWithCorrectNonce(rawTx, from, blockNumber, function(err, tx) { if (err) return callback(err); self.blockchain.processCall(tx, blockNumber, function (err, results) { @@ -587,7 +587,7 @@ StateManager.prototype.processCall = function (from, rawTx, blockNumber, callbac StateManager.prototype.processGasEstimate = function (from, rawTx, blockNumber, callback) { var self = this; - self.createFakeTransactionWithCorrectNonce(rawTx, from, function(err, tx) { + self.createFakeTransactionWithCorrectNonce(rawTx, from, blockNumber, function(err, tx) { if (err) return callback(err); self.blockchain.processCall(tx, blockNumber, function (err, results) { @@ -608,7 +608,7 @@ StateManager.prototype.processGasEstimate = function (from, rawTx, blockNumber, StateManager.prototype.processTransaction = function(from, rawTx, callback) { var self = this; - self.createFakeTransactionWithCorrectNonce(rawTx, from, function(err, tx) { + self.createFakeTransactionWithCorrectNonce(rawTx, from, 'latest', function(err, tx) { if (err) return callback(err); self.blockchain.queueTransaction(tx); @@ -813,7 +813,7 @@ StateManager.prototype.isUnlocked = function(address) { return this.unlocked_accounts[address.toLowerCase()] != null; }; -StateManager.prototype.createFakeTransactionWithCorrectNonce = function(rawTx, from, callback) { +StateManager.prototype.createFakeTransactionWithCorrectNonce = function(rawTx, from, blockNumber, callback) { const self = this; self.blockchain.getQueuedNonce(from, (err, expectedNonce) => { if (err) return callback(err); @@ -835,7 +835,7 @@ StateManager.prototype.createFakeTransactionWithCorrectNonce = function(rawTx, f // If we're calling a contract, check to make sure the address specified is a contract address if (_transactionIsContractCall(rawTx)) { - self.getCode(to.hex(rawTx.to), 'latest', function(err, code) { + self.getCode(to.hex(rawTx.to), blockNumber, function(err, code) { if (err) { callback(err); } else if (code === '0x0') {