I have the following problem:
currently i am testing in my local regtest
I generated the following cb-tx for block at height 119: 01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff03027700ffffffff0158bf122a010000001976a914a08da9e35ab58e957204703da9d48967ddd1703b88ac00000000
there are some tx in the mempool for the other tx i take the txid from the getblocktemplate request
I reverse the byte order for all of those and for the txid of the cbtx aswell.
still, i get the following error: bad-txnmrklroot
when i generate a block using generatetoaddress in regtest, then use getblock and run my merkle function over the txids, the merkle root is correct which means it is a issue with the coinbase txid
i realized that the coinbase tx from the generatetoaddress rpc call has a second output with 0 satoshis. is it possible to remove this second output so i can test further?
maybe someone had the same issue.
thanks in advance.
"594965c2bee7f6c939a6169147e4ed4c34a2a0b0776d03264e9532d51692d4e6", "cbc45f050ec7f2b5f9b08c2c280046bbc9f7e2ac1e5e0a2f8d734a0f19d4f918", "dde614820003084cc76b039978ecf29b91fe0edc9f1f766ad229ed94f2358d51", "370e8307db3990b089269b40afcdc55597e49577a0ff5eee715f343cb11ea45a", "404c3ef9fcab48d3d6ec39f66c991d4554b34477eab2e68a8ef26a40c63caf8e", "0c821f76d1003204a2415fa8d0b75d5da97e04d60c5d759c10db8f66dc78edbb"
I got the correct merkle root (88657de90640e52883dc88f8cadef1da6cea08cb377787f537e47c821512918e), so my code seems to be correct – FearXenon Oct 08 '23 at 10:55