Skip to content

Add support for lnd client compatibility - #952

Merged
evoskuil merged 6 commits into
libbitcoin:masterfrom
eynhaender:fix/bitcoind_lnd_bootstrap
Sep 19, 2026
Merged

evoskuil merged 6 commits into
libbitcoin:masterfrom
eynhaender:fix/bitcoind_lnd_bootstrap

Conversation

@eynhaender

Copy link
Copy Markdown
Contributor

lnd's bitcoind+ZMQ backend fails at wallet startup: it calls getrawmempool unconditionally, needs bip9_softforks in getblockchaininfo, and calls getmempoolinfo.

Implement getrawmempool and getmempoolinfo as empty results, since there is no v4 mempool and bitcoind never errors on these.

getmempoolinfo reports a max_money minimum fee when not pooling txs, matching the feefilter sent to peers. It also reports fullrbf as false.

Report bip9_softforks (taproot) from the shared getblockchaininfo serializer, once the confirmed height reaches the activation checkpoint.

lnd now reaches a full chain sync and can generate addresses against this node.

Comment thread src/serializers/bitcoind_json.cpp Outdated
Comment thread src/protocols/bitcoind/protocol_bitcoind_blockchain.cpp Outdated
Comment thread test/protocols/bitcoind/bitcoind_rpc.cpp Outdated
lnd's bitcoind+ZMQ backend cannot bootstrap without these: it calls
getrawmempool unconditionally to seed its ZMQ-fed mempool cache, and
checks getblockchaininfo's bip9_softforks for taproot activation.
Since v4 has no real mempool, respond honestly with empty results
(client_mempool_disabled for the entry-lookup methods that need one)
rather than erroring on calls a real node never rejects. Moves
bip9_softforks into the shared chain_info serializer since lnd's
taproot check is backend-agnostic, applying to btcd as well.
forks.bip341/bip342 mean the rules are enabled, not that taproot has
activated -- activation is a height (bip9_bit2_active_checkpoint),
per chain_state's own bip9_bit2_height gate. The previous chain_info
reported taproot "active" purely because the ruleset was configured,
which is wrong for any chain below its activation height (e.g. a
mainnet node still syncing past height 9 in these tests, or below
709632 in general).
…nts.

The node sends max_money as the feefilter when it is not pooling txs,
and does not accept unconfirmed conflicts.
The context flags record activation, so neither config nor height is checked.
@eynhaender
eynhaender force-pushed the fix/bitcoind_lnd_bootstrap branch from 0b96912 to 1735d1a Compare September 19, 2026 14:02

const auto& settings = node_settings();
const auto minimum = to_floating(minimum_fee_rate()) /
chain::satoshi_per_bitcoin;

@evoskuil evoskuil Sep 19, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I led you astray on this one, should be the config setting - regardless of currency. But the protocol update was still useful.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I pushed the recorrection into the PR.

@evoskuil
evoskuil merged commit 676313c into libbitcoin:master Sep 19, 2026
10 of 15 checks passed
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.

2 participants