Skip to content

Commit b82188f

Browse files
committed
reverse the order
1 parent 647a464 commit b82188f

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

node/src/wallets.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -399,14 +399,17 @@ impl RpcWallet {
399399
count: usize,
400400
skip: usize,
401401
) -> anyhow::Result<Vec<TxInfo>> {
402-
let transactions = wallet
403-
.spaces
404-
.transactions()
405-
.into_iter()
406-
.skip(skip)
407-
.take(count)
402+
let transactions = wallet.spaces.transactions().into_iter().collect::<Vec<_>>();
403+
404+
let total = transactions.len();
405+
let start = total.saturating_sub(skip + count);
406+
let end = total.saturating_sub(skip);
407+
408+
let transactions = transactions[start..end]
409+
.iter()
410+
.rev()
408411
.map(|ctx| {
409-
let tx = ctx.tx_node.tx;
412+
let tx = &ctx.tx_node.tx;
410413
let txid = ctx.tx_node.txid.clone();
411414
let confirmed = ctx.chain_position.is_confirmed();
412415
let (sent, received) = wallet.spaces.sent_and_received(&tx);

0 commit comments

Comments
 (0)