Only return "initial block amount" on init, and treat high fees in empty blocks as overpaid.

This commit is contained in:
softsimon
2020-03-16 02:25:14 +07:00
parent abf74c1aaf
commit 8a5887e890
2 changed files with 10 additions and 3 deletions

View File

@@ -98,12 +98,19 @@ export class TransactionComponent implements OnInit, OnDestroy {
.pipe(filter((block) => block.height === this.tx.status.block_height))
.subscribe((block) => {
const feePervByte = this.tx.fee / (this.tx.weight / 4);
let medianFee = block.feeRange[Math.round(block.feeRange.length * 0.5)];
if (feePervByte <= block.feeRange[Math.round(block.feeRange.length * 0.5)]) {
// Block not filled
if (block.weight < 4000000 * 0.95) {
medianFee = 1;
}
this.overpaidTimes = Math.round(feePervByte / block.medianFee);
if (feePervByte <= medianFee || this.overpaidTimes < 2) {
this.feeRating = 1;
} else {
this.feeRating = 2;
this.overpaidTimes = Math.round(feePervByte / block.medianFee);
if (this.overpaidTimes > 10) {
this.feeRating = 3;
}