0

I need to extract last wallet transaction. But seems listtransaction has some wrong logic. When I perform this function

listtransactions '*' 50 9

it just return me first records not last. In my case I have 11 records, so it return me record 1 and 2, instead of 10 and 11 as I expected. Thus I get first two records instead of last. Maybe I understood something wrong or missed some other params?

1

I need to extract last wallet transaction.

This will return last transaction in the wallet:

listtransactions "*" 1 0

For second last transaction:

listtransactions "*" 1 1

Last two transactions:

listtransactions "*" 2 0

Consider a wallet has 5 transactions.

listtransactions [LABEL] [COUNT] [SKIP]

Skip Tx
0 Tx5 [END]
1 Tx4
2 Tx3
3 Tx2
4 Tx1 [START]

If you skip 0 and count 1 in the above table you will get Tx5

If you skip 0 and count 2 in the above table you will get Tx4 and Tx5

If you skip 1(Tx5) and count 1 in the above table you will get Tx4

If you skip 1(Tx5) and count 2 in the above table you will get Tx3 and Tx4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.