]> Untitled Git - bdk/commit
Replace `rpc::CoreTxIter` with `list_transactions` fn.
author志宇 <hello@evanlinjin.me>
Sat, 6 Aug 2022 02:58:04 +0000 (10:58 +0800)
committer志宇 <hello@evanlinjin.me>
Mon, 8 Aug 2022 13:12:23 +0000 (21:12 +0800)
commit74e2c477f124489a2357921ca879cc82e24da5fd
tree2868c53d9f8a7f3b0d25d381e1b02ea7e0159ee6
parent5eeba6cced9a6fa0ad8ee4f64d04e1948620eac8
Replace `rpc::CoreTxIter` with `list_transactions` fn.

This fixes a bug where `CoreTxIter` attempts to call `listtransactions`
immediately after a tx result is filtered (instead of being returned),
when in fact, the correct logic will be to pop another tx result.

The new logic also ensures that tx results are returned in chonological
order. The test `test_list_transactions` verifies this. We also now
ensure that `page_size` is between the range `[0 to 1000]` otherwise an
error is returned.

Some needless cloning is removed from `from_config` as well as logging
improvements.
src/blockchain/rpc.rs