Merge pull request #814 from mempool/simon/block-transactions-sorting-fix
Sort block transactions first by height and then time
This commit is contained in:
commit
92b69657da
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user