Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chain: detect and use gettxspendingprevout RPC instead of mempool #887

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

Crypt-iQ
Copy link
Contributor

@Crypt-iQ Crypt-iQ commented Sep 7, 2023

This change uses the gettxspendingprevout RPC if the bitcoind version is greater or equal to version 24.0.0. In this case, the mempool is no longer used for zmq clients. The original behavior must be kept for rpc polling clients since they notify on new transactions and can only learn about them from polling the bitcoind mempool and keeping track of its own btcwallet mempool.

chain/bitcoind_conn.go Outdated Show resolved Hide resolved
chain/bitcoind_events.go Outdated Show resolved Hide resolved
chain/bitcoind_zmq_events.go Outdated Show resolved Hide resolved
chain/bitcoind_zmq_events.go Show resolved Hide resolved
chain/bitcoind_conn.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@guggero guggero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks quite good, should massively help with performance and memory usage.
Just one style related comment, pending @Roasbeef's comments.

chain/bitcoind_zmq_events.go Outdated Show resolved Hide resolved
This change uses the gettxspendingprevout RPC if the bitcoind version
is greater or equal to version 24.0.0. In this case, the mempool is
no longer used for zmq clients. The original behavior must be kept
for rpc polling clients since they notify on new transactions and can
only learn about them from polling the bitcoind mempool and keeping
track of its own btcwallet mempool.
Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐩

@Roasbeef Roasbeef merged commit fe40c37 into btcsuite:master Sep 29, 2023
3 checks passed
@Crypt-iQ Crypt-iQ deleted the bitcoind24 branch October 2, 2023 14:28
buck54321 pushed a commit to buck54321/btcwallet that referenced this pull request Apr 21, 2024
chain: detect and use gettxspendingprevout RPC instead of mempool
buck54321 pushed a commit to buck54321/btcwallet that referenced this pull request Apr 21, 2024
chain: detect and use gettxspendingprevout RPC instead of mempool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants