How does mining work on the moving target (variables change every second)? In bitcoin, miners hash the header twice with the SHA256 function. This header consists of the fields listed below:


version (v)
previousHashBlock (p)
merkleRoot (m)
time (t)
difficulty (d)
nonce (n)


Let's simplify and say that I am a pool miner with nonce range from 1-100. So if I do my share and find that on 9th minute the Nonce value of 91, solves the puzzle (proof of work). But by the time I send to network, merkleRoot and time has changed, so the nonce that I've found is not true anymore. We know that hash changes dramatically with slightest change of input, but in this formula, not one but TWO variable change constantly throughout my mining period (in this case 9 minute). Transaction occured and time changed.
So how does this formula hold true thoughout the mining time?

SHA256(v + p + m + t + d + n(91)) =&gt; 0000000asd8f686asd6das

Where m and t changes constantly? Wouldn't 91 be irrelevant at the time of finding?
Realistic miners run through all 2^32 possible nonces in much less than a second.

If a transaction occurred after you started your nonce search, then your block won't include that transaction. There's no problem with that.

If the time changed after you mined your block, then your block won't have the exact right time. Again, no problem with that.

And if you think about it, there can't be any problem with that. How would anyone know when you mined the block or whether the transaction occurred before or after you mined the block? It's mining that allows bitcoin to agree on these things, so if you mined the block, you're the one who gets to choose.