Hi,
I've come across an "issue" where after a "merkleblock"-message Multichain leaves out exactly one of transactions in the following "tx"-messages. I'm not sure whether this is intended behavior and I just misunderstood the Bitcoin documentation or an actual problem.
Here's the setup:
I'm using Multichain as a single full node in combination with a browser based Bitcoin SPV node (bcoin).
When the SPV node creates and announces a new unconfirmed transaction Multichain receives, validates and adds it to the next block as expected. Multichain proceeds to announce the new block ("inv"-message) and the SPV node requests it ("getdata"-message) as should be. In response, Multichain sends a "merkleblock"-message to the SPV node as well as separate "tx"-messages for all but one transaction of the newly created block.
From the Bitcoin documentation [1]:
The merkleblock message is a reply to a getdata message which requested a block using the inventory type MSG_MERKLEBLOCK. It is only part of the reply: if any matching transactions are found, they will be sent separately as tx messages.
And from [2]:
After a merkleblock, transactions matching the bloom filter are automatically sent in tx messages.
Since I didn't set a bloom filter I expected one "tx"-message for every transaction that is included in the block. However, Multichain leaves out exactly one of those transactions.
I've noticed that the missing transaction is always the one the SPV node announced earlier. My best guess here is that Multichain assumes the SPV node won't need that transaction a second time since it announced it in the first place? Is this intended behavior by Multichain or am I missing something here?
Thanks in advance and best regards
[1] https://bitcoin.org/en/developer-reference#merkleblock
[2] https://en.bitcoin.it/wiki/Protocol_documentation#filterload.2C_filteradd.2C_filterclear.2C_merkleblock