From 623b7e6ae79067cb80d1161337857b545deee6d6 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 8 Jun 2016 18:25:36 +0100 Subject: [PATCH] UDapp: move tryTillResponse() to a more logical location --- src/universal-dapp.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 178d1be661..f11c0b4e12 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -571,6 +571,17 @@ UniversalDApp.prototype.clickContractAt = function (self, $output, contract) { self.getInstanceInterface(contract, address, $output); }; +function tryTillResponse (web3, txhash, done) { + web3.eth.getTransactionReceipt(txhash, function (err, address) { + if (!err && !address) { + // Try again with a bit of delay + setTimeout(function () { tryTillResponse(web3, txhash, done); }, 500); + } else { + done(err, address); + } + }); +} + UniversalDApp.prototype.runTx = function (data, args, cb) { var self = this; var to = args.address; @@ -647,15 +658,4 @@ UniversalDApp.prototype.runTx = function (data, args, cb) { } }; -function tryTillResponse (web3, txhash, done) { - web3.eth.getTransactionReceipt(txhash, function (err, address) { - if (!err && !address) { - // Try again with a bit of delay - setTimeout(function () { tryTillResponse(web3, txhash, done); }, 500); - } else { - done(err, address); - } - }); -} - module.exports = UniversalDApp;