Fix effective fee rate detection on tx page
This commit is contained in:
parent
fb335f62db
commit
5870782abf
@ -622,8 +622,8 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
ancestors: tx.ancestors,
|
ancestors: tx.ancestors,
|
||||||
bestDescendant: tx.bestDescendant,
|
bestDescendant: tx.bestDescendant,
|
||||||
});
|
});
|
||||||
const hasRelatives = !!(tx.ancestors?.length || tx.bestDescendant);
|
const hasRelatives = !!(tx.ancestors?.length || tx.bestDescendant || tx.descendants);
|
||||||
this.hasEffectiveFeeRate = hasRelatives || (tx.effectiveFeePerVsize && (Math.abs(tx.effectiveFeePerVsize - tx.feePerVsize) >= 0.1));
|
this.hasEffectiveFeeRate = hasRelatives || (tx.effectiveFeePerVsize && tx.effectiveFeePerVsize !== (this.tx.fee / (this.tx.weight / 4)) && tx.effectiveFeePerVsize !== (tx.fee / Math.ceil(tx.weight / 4)));
|
||||||
} else {
|
} else {
|
||||||
this.fetchCpfp$.next(this.tx.txid);
|
this.fetchCpfp$.next(this.tx.txid);
|
||||||
}
|
}
|
||||||
@ -831,8 +831,8 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.sigops = this.cpfpInfo.sigops;
|
this.sigops = this.cpfpInfo.sigops;
|
||||||
this.adjustedVsize = this.cpfpInfo.adjustedVsize;
|
this.adjustedVsize = this.cpfpInfo.adjustedVsize;
|
||||||
}
|
}
|
||||||
this.hasCpfp =!!(this.cpfpInfo && (this.cpfpInfo.bestDescendant || this.cpfpInfo.descendants?.length || this.cpfpInfo.ancestors?.length));
|
this.hasCpfp =!!(this.cpfpInfo && relatives.length);
|
||||||
this.hasEffectiveFeeRate = hasRelatives || (this.tx.effectiveFeePerVsize && (Math.abs(this.tx.effectiveFeePerVsize - this.tx.feePerVsize) > 0.01));
|
this.hasEffectiveFeeRate = hasRelatives || (this.tx.effectiveFeePerVsize && this.tx.effectiveFeePerVsize !== (this.tx.fee / (this.tx.weight / 4)) && this.tx.effectiveFeePerVsize !== (this.tx.fee / Math.ceil(this.tx.weight / 4)));
|
||||||
}
|
}
|
||||||
|
|
||||||
setIsAccelerated(initialState: boolean = false) {
|
setIsAccelerated(initialState: boolean = false) {
|
||||||
|
@ -17,6 +17,7 @@ export interface Transaction {
|
|||||||
feePerVsize?: number;
|
feePerVsize?: number;
|
||||||
effectiveFeePerVsize?: number;
|
effectiveFeePerVsize?: number;
|
||||||
ancestors?: Ancestor[];
|
ancestors?: Ancestor[];
|
||||||
|
descendants?: Ancestor[];
|
||||||
bestDescendant?: BestDescendant | null;
|
bestDescendant?: BestDescendant | null;
|
||||||
cpfpChecked?: boolean;
|
cpfpChecked?: boolean;
|
||||||
acceleration?: boolean;
|
acceleration?: boolean;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user