feat: add more debug logs

This commit is contained in:
José Oliveira 2022-02-17 22:38:00 +00:00
parent e48de472e4
commit 1bc76679dd

View file

@ -66,7 +66,7 @@ function sendCoins (account, tx, settings, operatorId, feeMultiplier) {
return checkCryptoCode(cryptoCode) return checkCryptoCode(cryptoCode)
.then(() => calculateFeeDiscount(feeMultiplier)) .then(() => calculateFeeDiscount(feeMultiplier))
.then(newFee => { .then(newFee => {
console.log('** DEBUG MINERS FEE ** - Calculated fee discount: ', newFee) logger.info('** DEBUG MINERS FEE ** - Calculated fee discount: ', newFee)
return fetch('settxfee', [newFee]) return fetch('settxfee', [newFee])
}) })
.then(() => fetch('sendtoaddress', [toAddress, coins])) .then(() => fetch('sendtoaddress', [toAddress, coins]))
@ -87,7 +87,10 @@ function sendCoins (account, tx, settings, operatorId, feeMultiplier) {
function sendCoinsBatch (account, txs, cryptoCode, feeMultiplier) { function sendCoinsBatch (account, txs, cryptoCode, feeMultiplier) {
return checkCryptoCode(cryptoCode) return checkCryptoCode(cryptoCode)
.then(() => calculateFeeDiscount(feeMultiplier)) .then(() => calculateFeeDiscount(feeMultiplier))
.then(newFee => fetch('settxfee', [newFee])) .then(newFee => {
logger.info('** DEBUG MINERS FEE ** - Calculated fee discount: ', newFee)
return fetch('settxfee', [newFee])
})
.then(() => { .then(() => {
const txAddressAmountPairs = _.map(tx => [tx.address, tx.cryptoAtoms.shiftedBy(-unitScale).toFixed(8)], txs) const txAddressAmountPairs = _.map(tx => [tx.address, tx.cryptoAtoms.shiftedBy(-unitScale).toFixed(8)], txs)
return Promise.all([JSON.stringify(_.fromPairs(txAddressAmountPairs))]) return Promise.all([JSON.stringify(_.fromPairs(txAddressAmountPairs))])