comply with project coding style
This commit is contained in:
parent
9a921ad181
commit
4028bd50f2
1 changed files with 10 additions and 10 deletions
|
@ -1,18 +1,18 @@
|
||||||
var https = require('https')
|
var https = require('https')
|
||||||
|
|
||||||
function faucetWithdraw(address, amount, done) {
|
function faucetWithdraw (address, amount, done) {
|
||||||
var url = "https://coconut-macaroon.herokuapp.com/withdrawal?address=" + address + "&amount=" + amount
|
var url = 'https://coconut-macaroon.herokuapp.com/withdrawal?address=' + address + '&amount=' + amount
|
||||||
https.get(url, function(res) {
|
https.get(url, function (res) {
|
||||||
res.statusCode == 200 ? done(null) : done(new Error("non-200 status: " + res.statusCode))
|
res.statusCode === 200 ? done(null) : done(new Error('non-200 status: ' + res.statusCode))
|
||||||
}).on('error', done)
|
}).on('error', done)
|
||||||
}
|
}
|
||||||
|
|
||||||
function pollUnspent(blockchain, address, done) {
|
function pollUnspent (blockchain, address, done) {
|
||||||
blockchain.addresses.unspents(address, function (err, unspents) {
|
blockchain.addresses.unspents(address, function (err, unspents) {
|
||||||
if (err) return done(err)
|
if (err) return done(err)
|
||||||
|
|
||||||
if(unspents == null || unspents.length === 0) {
|
if (!unspents || unspents.length === 0) {
|
||||||
return setTimeout(function() {
|
return setTimeout(function () {
|
||||||
pollUnspent(blockchain, address, done)
|
pollUnspent(blockchain, address, done)
|
||||||
}, 200)
|
}, 200)
|
||||||
}
|
}
|
||||||
|
@ -21,12 +21,12 @@ function pollUnspent(blockchain, address, done) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function pollSummary(blockchain, address, done) {
|
function pollSummary (blockchain, address, done) {
|
||||||
blockchain.addresses.summary(address, function (err, result) {
|
blockchain.addresses.summary(address, function (err, result) {
|
||||||
if (err) return done(err)
|
if (err) return done(err)
|
||||||
|
|
||||||
if(result.balance == 0) {
|
if (result.balance === 0) {
|
||||||
return setTimeout(function() {
|
return setTimeout(function () {
|
||||||
pollSummary(blockchain, address, done)
|
pollSummary(blockchain, address, done)
|
||||||
}, 200)
|
}, 200)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue