6

I read What exactly is Mining? and What are bitcoin miners really solving?, but was left wondering: What happens if a new transaction comes in, whilst mining? To answer that, I found Do transactions affect the discovery of a block?, which, if I understand correctly, says that the mining must "start over" (but the chances of finding the "nonce" on the first attempt are about the same as any subsequent attempts, so there's no "loss of work").

But, what about network latency? It must take a finite amount of time for a new transaction to reach miners—so what happens if a miner solves a block, but then receives a transaction timestamped before the block was solved?

2 Answers 2

4

Miners have total freedom to choose which transactions they will include in their blocks. Most miners will include any transaction that reaches them (assuming it includes an appropriate fee) but nothing forces them to do so.

But if a miner decides, for whatever reason, to omit a particular transaction, or if it's omitted by an accident of timing, no permanent harm is done. Another miner can include that transaction in a later block with no problem. Transactions don't even have a timestamp, per se, so it's not a problem if it takes a long time (other than the inconvenience to the parties involved). (Blockchain.info and its ilk may record the time at which they first saw the transaction on the network, but that time stamp isn't part of the transaction itself, as far as I know.)

2
  • I see, thanks. One follow-up question though, to make sure I understand this. Does that mean that a miner may, theoretically, solve a block without including any new transactions?—that is, the same set of transactions as the previous block? (As I understand, the new block must include the hash of the previous block, so it's just as difficult a problem.) If so, is the only reason this doesn't happen, that miners wouldn't collect transaction fees by doing so? Feb 25, 2014 at 7:32
  • 1
    @acheong: Yes, indeed, a block with no transactions is still valid. There was a previous question addressing this but I can't conveniently find it right now. Feb 25, 2014 at 7:37
3

It is up to individual mining pools to decide how quickly to include newly received transactions. There are no strict rules here and delays of a few minutes are usually acceptable. Transactions with higher fees may encourage miners to include them in a block ASAP.

3
  • So, a block generated at 09:53:28 is still valid even if it doesn't include a transaction that was transacted at 09:53:27? Feb 25, 2014 at 7:17
  • 2
    Yes. In fact miners have no obligation to include any transaction before a "deadline" -- it is only done on a best effort basis. It is perfectly acceptable for a mining pool to aggregate new transactions in a queue and only include them say every 5 minutes.
    – uminatsu
    Feb 25, 2014 at 7:22
  • 1
    If there was a way to ensure that everyone agreed when a transaction was performed and saw it when they had to decide whether a block was valid, there would be no need for mining. Feb 25, 2014 at 7:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.