diff --git a/lib/plugins/zero-conf/blockcypher/blockcypher.js b/lib/plugins/zero-conf/blockcypher/blockcypher.js index 3b0829ed..7e35e9d7 100644 --- a/lib/plugins/zero-conf/blockcypher/blockcypher.js +++ b/lib/plugins/zero-conf/blockcypher/blockcypher.js @@ -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) @@ -49,4 +52,4 @@ function authorize (account, toAddress, cryptoAtoms, cryptoCode, isBitcoindAvail } }) }) -} \ No newline at end of file +}