Nice to know, What you mean with " I think lucky your transaction faill" ? BTW edit your post and quote it correctly.
I’ll try to explain better.
In my btc_miner, using Bitcoin Core and an RPC connection, I have access to all unverified transactions.
In this mempool, for example, I have 15,000 transactions. It’s impossible to include all of them in the block for mining.
I have limited space, so I typically choose between 3,000 to 5,000 transactions to be included in the block.
To make it profitable, I select transactions with higher fees first and then add those with lower fees to the block.
Once the transactions are defined, along with the Merkle tree and the previous block hash, I attempt to find the nonce.
The goal is to find a SHA-256 double hash with 19 leading zeros within the 2^32 possible nonce values.
If a valid nonce isn’t found, the process restarts. The miner who discovers the nonce and submits it first wins.
Unfortunately, after 5 months, I haven’t been able to mine any block. I only have 3 RTX 3080 GPUs; I don’t have an ASIC machine.
Therefore, Alberto, it’s possible that the miner didn’t choose your transaction, even if it had a higher fee.