Commit ffc8e957 authored by Alex Beregszaszi's avatar Alex Beregszaszi

UDapp: simplify tryTillResponse()

parent d5e39845
...@@ -644,15 +644,14 @@ UniversalDApp.prototype.runTx = function (data, args, cb) { ...@@ -644,15 +644,14 @@ UniversalDApp.prototype.runTx = function (data, args, cb) {
}; };
function tryTillResponse (web3, txhash, done) { function tryTillResponse (web3, txhash, done) {
web3.eth.getTransactionReceipt(txhash, testResult); web3.eth.getTransactionReceipt(txhash, function (err, address) {
function testResult (err, address) {
if (!err && !address) { if (!err && !address) {
// Try again with a bit of delay
setTimeout(function () { tryTillResponse(web3, txhash, done); }, 500); setTimeout(function () { tryTillResponse(web3, txhash, done); }, 500);
} else { } else {
done(err, address); done(err, address);
} }
} });
} }
module.exports = UniversalDApp; module.exports = UniversalDApp;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment