Sort block transactions first by height and then time

fixes #770
This commit is contained in:
softsimon 2021-09-25 16:28:11 +04:00
parent 31a0d44543
commit ffa18bbe71
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
2 changed files with 14 additions and 2 deletions

View File

@ -142,7 +142,13 @@ export class AddressComponent implements OnInit, OnDestroy {
this.tempTransactions[this.timeTxIndexes[index]].firstSeen = time;
});
this.tempTransactions.sort((a, b) => {
return b.status.block_time - a.status.block_time || b.firstSeen - a.firstSeen;
if (b.status.confirmed) {
if (b.status.block_height === a.status.block_height) {
return b.status.block_time - a.status.block_time;
}
return b.status.block_height - a.status.block_height;
}
return b.firstSeen - a.firstSeen;
});
this.transactions = this.tempTransactions;

View File

@ -136,7 +136,13 @@ export class AssetComponent implements OnInit, OnDestroy {
this.tempTransactions[this.timeTxIndexes[index]].firstSeen = time;
});
this.tempTransactions.sort((a, b) => {
return b.status.block_time - a.status.block_time || b.firstSeen - a.firstSeen;
if (b.status.confirmed) {
if (b.status.block_height === a.status.block_height) {
return b.status.block_time - a.status.block_time;
}
return b.status.block_height - a.status.block_height;
}
return b.firstSeen - a.firstSeen;
});
this.transactions = this.tempTransactions;