January 2019
Beginner to intermediate
372 pages
11h 17m
English
All the unconfirmed transactions created by the user and other nodes are included in the transaction pool. The transaction pool could be a local file or an in-memory pool. We will maintain all the transactions in a list stored in memory:
transaction_pool = []
Whenever a transaction is created by a node, it is added to the local transaction pool before broadcasting. The following send_transaction method adds the transaction to the pool after creating the transaction:
def send_transaction(self, address, amount):
tx = create_transaction(address, amount, get_private_from_wallet(), self.get_unspent_tx_outs(), get_transaction_pool())
add_to_transaction_pool(tx, self.get_unspent_tx_outs())
return tx
These transactions remain in ...