FIX: incorrect fees occasionally (for some electrum servers); better fee estimation

This commit is contained in:
overtorment 2023-09-28 20:15:40 +01:00
parent ba737f9cf2
commit 7ddc0e8f0a

View File

@ -10,6 +10,10 @@ export const NetworkTransactionFeeType = Object.freeze({
export class NetworkTransactionFee { export class NetworkTransactionFee {
static StorageKey = 'NetworkTransactionFee'; static StorageKey = 'NetworkTransactionFee';
private fastestFee: number;
private mediumFee: number;
private slowFee: number;
constructor(fastestFee = 2, mediumFee = 1, slowFee = 1) { constructor(fastestFee = 2, mediumFee = 1, slowFee = 1) {
this.fastestFee = fastestFee; this.fastestFee = fastestFee;
this.mediumFee = mediumFee; this.mediumFee = mediumFee;
@ -18,7 +22,7 @@ export class NetworkTransactionFee {
} }
export default class NetworkTransactionFees { export default class NetworkTransactionFees {
static recommendedFees() { static recommendedFees(): Promise<NetworkTransactionFee> {
// eslint-disable-next-line no-async-promise-executor // eslint-disable-next-line no-async-promise-executor
return new Promise(async resolve => { return new Promise(async resolve => {
try { try {