Skip to Content
Hands-On Blockchain for Python Developers
book

Hands-On Blockchain for Python Developers

by Arjuna Sky Kok
February 2019
Intermediate to advanced
450 pages
9h 59m
English
Packt Publishing
Content preview from Hands-On Blockchain for Python Developers

Thread classes

Now, let's write thread objects in order to access the blockchain. When creating a transaction in a blockchain, you usually want to use a thread or non-blocking function. Consequently, every time we want to broadcast a transaction, we use these thread classes. These thread classes will use the blockchain object that we have described previously.

Use the following code block to create a balance_thread.py file in the wallet_threads directory:

from PySide2.QtCore import QThread, Signalfrom time import sleepfrom blockchain import blockchainclass BalanceThread(QThread):    get_balance_transaction = Signal(map)    def __init__(self, parent=None):        super(BalanceThread, self).__init__(parent)        self.quit = False    def kill(self): self.quit = ...
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 in Action

Blockchain in Action

Bina Ramamurthy
Learn Python by Building a Blockchain and Cryptocurrency

Learn Python by Building a Blockchain and Cryptocurrency

Academind by Maximilian Schwarzmüller GmbH

Publisher Resources

ISBN: 9781788627856Supplemental Content