]> Untitled Git - bdk/commit
bitcoind_rpc: rm `BlockHash` from `Emitter::last_mempool_tip`
author志宇 <hello@evanlinjin.me>
Fri, 6 Oct 2023 09:39:22 +0000 (17:39 +0800)
committer志宇 <hello@evanlinjin.me>
Mon, 9 Oct 2023 14:14:04 +0000 (22:14 +0800)
commit57590e0a1f2dad09a63fadb11f01e9f704cdcffb
tree1a612a0459cc8b0e6bc357e8729fbc8089708749
parent6d4b33ef91a6c3e3443f6321cf3e3d186f77c595
bitcoind_rpc: rm `BlockHash` from `Emitter::last_mempool_tip`

Instead of comparing the blockhash against the emitted_blocks map
to see whether the block is part of the emitter's best chain, we
reduce the `last_mempool_tip` height to the last agreement height
during the polling logic.

The benefits of this is we have tighter bounds for avoiding re-
emission. Also, it will be easier to replace `emitted_blocks` to
a `CheckPoint` (since we no longer rely on map lookup).
crates/bitcoind_rpc/src/lib.rs
crates/bitcoind_rpc/tests/test_emitter.rs