Author

Topic: Noob's question on transaction in the block and related source code (Read 754 times)

hero member
Activity: 784
Merit: 1000
Line 84 in miner.cpp is a good place to start (https://github.com/bitcoin/bitcoin/blob/master/src/miner.cpp).

Mind you that some pools may use custom implementations that apply different logic to decide which transactions to include. As long as all transactions included in a block are valid, it is up to the miner to decide exactly what to include and what to leave out.

Thanks for your reply, that's great and really helpful.

I can see from the source code that the miner try to include transactions from the memory pool. If I understand correctly the main.cpp line 3888 populates the memory pool with transactions. Are these messages with the strCommand value "tx" transactions from p2p clients such my wallet when I send BTC to some one? If yes, does it mean that many miners would include my transaction and the lucky one who finally get the block will put the block that includes my transaction into the block chain?

hero member
Activity: 728
Merit: 500
Line 84 in miner.cpp is a good place to start (https://github.com/bitcoin/bitcoin/blob/master/src/miner.cpp).

Mind you that some pools may use custom implementations that apply different logic to decide which transactions to include. As long as all transactions included in a block are valid, it is up to the miner to decide exactly what to include and what to leave out.
hero member
Activity: 784
Merit: 1000
I have been buying and using bitcoin in the last two years, but was never interested in the technical details and underlying concept. Now I am reading more and more technical materials and being really fascinated by how bitcoin works, what a good technology it is. Unfortunately more reading raises more and more questions. The newest topic I would like to understand how transactions are recorded in the block more precisely what handles that process (putting new transactions into the block). If I understood correctly miners who generate the block will include the incoming transactions in it. According to the wiki, "all peers trying to solve blocks collect the transaction records and add them to the block they're working to solve". My question is which software component does that, is it the bitcoind software or the mining pool would handle that? If the bitcoin core software does that, would you mind to let me know where is that in the source code? Tracking down step by step the process by reading the source I would understand better what's happening under the hood.
Jump to: