Skip to Content
Foundations of Blockchain
book

Foundations of Blockchain

by Koshik Raj
January 2019
Beginner to intermediate
372 pages
11h 17m
English
Packt Publishing
Content preview from Foundations of Blockchain

Transaction pool

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Blockchain Basics

Blockchain Basics

Daniel Drescher
What Is Blockchain?

What Is Blockchain?

Sir John Hargrave, Evan Karnoupakis
Mastering Blockchain

Mastering Blockchain

Lorne Lantz, Daniel Cawrey

Publisher Resources

ISBN: 9781789139396Supplemental Content