refactor: variable rename and remove trailing spaces
This commit is contained in:
parent
d338d0adca
commit
e62245098b
1 changed files with 7 additions and 4 deletions
|
|
@ -13,21 +13,24 @@ function highConfidence (confidence, txref) {
|
|||
}
|
||||
|
||||
function authorize (account, toAddress, cryptoAtoms, cryptoCode, isBitcoindAvailable) {
|
||||
var promise = []
|
||||
let promise = []
|
||||
return Promise.resolve()
|
||||
.then(() => {
|
||||
if (cryptoCode !== 'BTC') throw new Error('Unsupported crypto: ' + cryptoCode)
|
||||
|
||||
const query = qs.stringify({
|
||||
token: account.token,
|
||||
includeConfidence: true
|
||||
})
|
||||
|
||||
const confidence = account.confidenceFactor
|
||||
const verifyRBF = account.rbf
|
||||
const isRBFEnabled = account.rbf
|
||||
const url = `https://api.blockcypher.com/v1/btc/main/addrs/${toAddress}?${query}`
|
||||
|
||||
return axios.get(url)
|
||||
.then(r => {
|
||||
const data = r.data
|
||||
if (isBitcoindAvailable && verifyRBF && data.unconfirmed_txrefs) {
|
||||
if (isBitcoindAvailable && isRBFEnabled && data.unconfirmed_txrefs) {
|
||||
_.map(unconfirmedTxref => {
|
||||
promise.push(new Promise((resolve, reject) => { resolve(fetchRBF(unconfirmedTxref.tx_hash)) }))
|
||||
}, data.unconfirmed_txrefs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue