FIX: priority fee will be always at least 2 sat/vb to beat other 1 sat/vb transactions in the mempool (closes #4902)

This commit is contained in:
overtorment 2023-01-01 18:18:15 +00:00
parent c57cbc1772
commit 4fe7281805
2 changed files with 4 additions and 4 deletions

View File

@ -832,7 +832,7 @@ module.exports.estimateFees = async function () {
const _slow = await module.exports.estimateFee(144);
// calculating fast fees from mempool:
const fast = module.exports.calcEstimateFeeFromFeeHistorgam(1, histogram);
const fast = Math.max(2, module.exports.calcEstimateFeeFromFeeHistorgam(1, histogram));
// recalculating medium and slow fees using bitcoincore estimations only like relative weights:
// (minimum 1 sat, just for any case)
const medium = Math.max(1, Math.round((fast * _medium) / _fast));

View File

@ -10,7 +10,7 @@ export const NetworkTransactionFeeType = Object.freeze({
export class NetworkTransactionFee {
static StorageKey = 'NetworkTransactionFee';
constructor(fastestFee = 1, mediumFee = 1, slowFee = 1) {
constructor(fastestFee = 2, mediumFee = 1, slowFee = 1) {
this.fastestFee = fastestFee;
this.mediumFee = mediumFee;
this.slowFee = slowFee;
@ -31,12 +31,12 @@ export default class NetworkTransactionFees {
const networkFee = new NetworkTransactionFee(response.fast, response.medium, response.slow);
resolve(networkFee);
} else {
const networkFee = new NetworkTransactionFee(1, 1, 1);
const networkFee = new NetworkTransactionFee(2, 1, 1);
resolve(networkFee);
}
} catch (err) {
console.warn(err);
const networkFee = new NetworkTransactionFee(1, 1, 1);
const networkFee = new NetworkTransactionFee(2, 1, 1);
resolve(networkFee);
}
});