mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 09:50:15 +01:00
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:
parent
c57cbc1772
commit
4fe7281805
@ -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));
|
||||
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user