Merge pull request #1236 from chaotixkilla/fix-btc-fee-selection

Send newFee as a number and serve more fee options
This commit is contained in:
Rafael Taranto 2022-05-24 09:49:28 +01:00 committed by GitHub
commit 522e984590
2 changed files with 9 additions and 1 deletions

View file

@ -79,7 +79,7 @@ function sendCoins (account, tx, settings, operatorId, feeMultiplier) {
return checkCryptoCode(cryptoCode)
.then(() => calculateFeeDiscount(feeMultiplier))
.then(newFee => fetch('settxfee', [newFee]))
.then(newFee => fetch('settxfee', [newFee.toNumber()]))
.then(() => fetch('sendtoaddress', [toAddress, coins]))
.then((txId) => fetch('gettransaction', [txId]))
.then((res) => _.pick(['fee', 'txid'], res))

View file

@ -58,10 +58,18 @@ const viewFeeMultiplier = it =>
R.compose(R.prop(['display']), R.find(R.propEq('code', it)))(feeOptions)
const feeOptions = [
{ display: '+60%', code: '1.6' },
{ display: '+50%', code: '1.5' },
{ display: '+40%', code: '1.4' },
{ display: '+30%', code: '1.3' },
{ display: '+20%', code: '1.2' },
{ display: '+10%', code: '1.1' },
{ display: 'Default', code: '1' },
{ display: '-10%', code: '0.9' },
{ display: '-20%', code: '0.8' },
{ display: '-30%', code: '0.7' },
{ display: '-40%', code: '0.6' },
{ display: '-50%', code: '0.5' },
{ display: '-60%', code: '0.4' }
]