Currently, the RPC listtransactions
command returns the latest X transactions of the wallet starting from Y. This means that to get the X oldest transacions would require first to call getwalletinfo
command to get the total transactions count, and then use that to know what count to pass the listtransactions
command.
This PR adds an optional flag to allow instead to start going through the transactions list from the oldest to the newest, so it will be possible to get the oldest X transactions of the wallet starting from Y.
For example, this will return the oldest transaction of the wallet:
0bitcoin-cli -rpcuser=bitcoin -rpcpassword=secret -rpcwallet= listtransactions "*" 1 0 true false
This will return the 2nd and 3rd oldest transactions of the wallet:
0bitcoin-cli -rpcuser=bitcoin -rpcpassword=secret -rpcwallet= listtransactions "*" 2 1 true false
Not including the new flag or setting it to true will not change the current behavior.