Skip to content

Commit 7182aca

Browse files
committed
f Also sort confirmed txs by pos
1 parent a6c0b40 commit 7182aca

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/access.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,11 @@ where
173173
unspent_registered_outputs.push(output);
174174
}
175175

176-
// Sort all confirmed transactions by block height and feed them to the interface
177-
// in order.
176+
// Sort all confirmed transactions first by block height, then by in-block
177+
// position, and finally feed them to the interface in order.
178178
confirmed_txs.sort_unstable_by(
179-
|(_, block_height1, _, _), (_, block_height2, _, _)| {
180-
block_height1.cmp(&block_height2)
179+
|(_, block_height1, _, pos1), (_, block_height2, _, pos2)| {
180+
block_height1.cmp(&block_height2).then_with(|| pos1.cmp(&pos2))
181181
},
182182
);
183183
for (tx, block_height, block_header, pos) in confirmed_txs {

0 commit comments

Comments
 (0)