As described in the article on nodes, nodes check all transactions for validity. The nodes must agree on the order in which the many transactions sent to the Bitcoin network took place. Accordingly, there must be only one transaction history in which all transactions that take place over the Bitcoin network are recorded in rows of blocks. This transaction history is the blockchain. At any given time, almost all the nodes in the Bitcoin network have a temporary list of unacknowledged transactions in addition to the blockchain. This list is called a “mempool”, storage pool or transaction pool. Nodes use this mempool to track transactions known to the network but not yet included in the blockchain. This means they still need to be validated and then sent to the miners to appear in the next block.
The Network is Not Flawless
Unconfirmed transactions have not yet reached consensus, so each node by definition has a slightly different version of the outstanding mempool. In practice, this occurs because the peer-to-peer network is not perfect. Therefore, some nodes may have heard of a transaction that other nodes have not heard of. To validate the transactions, the nodes integrate the pending transactions into their mempool and forward them to neighboring nodes on the network for validation.
Validation of Transactions
The nodes now use the blockchain to trace back the entire transaction history of the respective bitcoin sender. They check to see if the sender has enough bitcoins for the transaction in his wallet, the digital purse, if he is the actual owner of those bitcoins, and if he might try to send the same bitcoins twice. That would be an attempt of forgery. If it turns out that the sender is actually the owner of the bitcoins, that the bitcoins are also sufficient for the transaction, and that he does not attempt forgery, the node takes the transaction from the mempool and sends it to the miners. The miners integrate them into the next block of the blockchain and carry out the transaction. The bitcoins will be sent.
Antonopoulos, A. M. (2017). Mastering Bitcoin: Programming the Open Blockchain (2nd ed.). Sebastopol: O’Reilly Media.
Narayanan, A., Bonneau, J., Felten, E., Miller, A., & Goldfeder, S. (2016). Bitcoin and Cryptocurrency Technologies: A Comprehensive Introduction. Princeton, New Jersey: Princeton University Press.