fix: missing var, removing testing leftovers
This commit is contained in:
parent
d3533c44f0
commit
d735b2dc67
1 changed files with 1 additions and 5 deletions
|
|
@ -74,7 +74,6 @@ function calculateFeeDiscount (feeMultiplier = 1, unitScale) {
|
||||||
}
|
}
|
||||||
// transform from sat/vB to BTC/kvB and apply the multipler
|
// transform from sat/vB to BTC/kvB and apply the multipler
|
||||||
const newFee = estimatedFee.shiftedBy(-unitScale+3).times(feeMultiplier)
|
const newFee = estimatedFee.shiftedBy(-unitScale+3).times(feeMultiplier)
|
||||||
console.log(newFee.toFixed())
|
|
||||||
if (newFee.lt(0.00001) || newFee.gt(0.1)) {
|
if (newFee.lt(0.00001) || newFee.gt(0.1)) {
|
||||||
logger.info('fee outside safety parameters, defaulting to automatic fee selection')
|
logger.info('fee outside safety parameters, defaulting to automatic fee selection')
|
||||||
return AUTOMATIC_FEE
|
return AUTOMATIC_FEE
|
||||||
|
|
@ -89,7 +88,7 @@ function sendCoins (account, tx, settings, operatorId, feeMultiplier) {
|
||||||
|
|
||||||
return checkCryptoCode(cryptoCode)
|
return checkCryptoCode(cryptoCode)
|
||||||
.then(() => calculateFeeDiscount(feeMultiplier, unitScale))
|
.then(() => calculateFeeDiscount(feeMultiplier, unitScale))
|
||||||
.then(() => fetch('settxfee', [newFee]))
|
.then(newFee => fetch('settxfee', [newFee]))
|
||||||
.then(() => fetch('sendtoaddress', [toAddress, coins]))
|
.then(() => fetch('sendtoaddress', [toAddress, coins]))
|
||||||
.then((txId) => fetch('gettransaction', [txId]))
|
.then((txId) => fetch('gettransaction', [txId]))
|
||||||
.then((res) => _.pick(['fee', 'txid'], res))
|
.then((res) => _.pick(['fee', 'txid'], res))
|
||||||
|
|
@ -208,8 +207,6 @@ function getTxHashesByAddress (cryptoCode, address) {
|
||||||
.then(_.map(({ hash }) => hash))
|
.then(_.map(({ hash }) => hash))
|
||||||
}
|
}
|
||||||
|
|
||||||
calculateFeeDiscount(1, 8).then(console.log)
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
balance,
|
balance,
|
||||||
sendCoins,
|
sendCoins,
|
||||||
|
|
@ -218,7 +215,6 @@ module.exports = {
|
||||||
newFunding,
|
newFunding,
|
||||||
cryptoNetwork,
|
cryptoNetwork,
|
||||||
fetchRBF,
|
fetchRBF,
|
||||||
estimateFee,
|
|
||||||
sendCoinsBatch,
|
sendCoinsBatch,
|
||||||
checkBlockchainStatus,
|
checkBlockchainStatus,
|
||||||
getTxHashesByAddress,
|
getTxHashesByAddress,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue