As new transactions are broadcasted, the nodes keep them in a pool of unconfirmed transactions.
One node will add it to a block as soon as it finds a proof of work. At the same time many other nodes are working on the same transactions. When a new block is broadcasted to the network, it should either be marked as confirmed or removed from the pool.
I have a few questions about this process:
1- how the other nodes know the new block is already created so they should stop working on it? (or they don't?)
2- when a new block of transactions are added to the blockchain how the other nodes know they should not consider that transactions in their next attempt? They read the node and mark the transaction as confirmed of remove them? Is there any other kind of message they exchange?
3- if 2 new blocks are added to the blockchain in different branches. the first branch as active because that block came first. a new block arrives and the second branch is discarded. what happens to the transactions in the discarded branch? they are already in the other two blocks of the blockchain for sure? what do the nodes do with them?
thanks!