pybit/py2/block.py
def api_verify(self,
                   url="https://blockchain.info/rawblock/",
                   wait=False):
        """
        Query a block hash from Blockchain.info's api. Check it matches the
        blockon size, merkle root, number of transactions, previous block hash

        Respects apis request limting queries to 1 every 10s. If wait is True,
        waits to query. If false, skips.

        TODO:
            - Tidy printing
        """

        if self.verb > 3:
            print "{0}{1}Validating{1}".format(" "*3,
                                               "_"*10)

        jr = self.api_get(url=url,
                          wait=False)

        if jr is not None:
            # Use these fields for validation
            validationFields = {
                    self.hash: jr['hash'],
                    self.blockSize: jr['size'],
                    self.merkleRootHash: jr['mrkl_root'],
                    self.nTransactions: jr['n_tx'],
                    self.prevHash: jr['prev_block'],
                    self.nonce: jr['nonce'],
                    self.timestamp: jr['time']
                                }

            self.api_validated = self.api_check(jr, validationFields)
        else:
            self.api_validated = 'Skipped'

        # Report
        if self.verb > 3:
            print "{0}Validation passed: {1}\n{0}{2}".format(
                                            " "*3,
                                            self.api_validated,
                                            "_"*30)

        Query a block hash from Blockchain.info's api. Check it matches the
        blockon size, merkle root, number of transactions, previous block hash

        Respects apis request limting queries to 1 every 10s. If wait is True,
        waits to query. If false, skips.

        TODO:
            - Tidy printing
        
Query a block hash from Blockchain.info's api. Check it matches the
blockon size, merkle root, number of transactions, previous block hash

Respects apis request limting queries to 1 every 10s. If wait is True,
waits to query. If false, skips.

Tidy printing
Query a block hash from Blockchain . info ' s api . Check it matches the blockon size merkle root number of transactions previous block hash Respects apis request limting queries to 1 every 10s . If wait is True waits to query . If false skips . Tidy printing
def api_verify(self,
                   url="https://blockchain.info/rawblock/",
                   wait=False):
        if self.verb > 3:
            print "{0}{1}Validating{1}".format(" "*3,
                                               "_"*10)
        jr = self.api_get(url=url,
                          wait=False)
        if jr is not None:
            validationFields = {
                    self.hash: jr['hash'],
                    self.blockSize: jr['size'],
                    self.merkleRootHash: jr['mrkl_root'],
                    self.nTransactions: jr['n_tx'],
                    self.prevHash: jr['prev_block'],
                    self.nonce: jr['nonce'],
                    self.timestamp: jr['time']
                                }
            self.api_validated = self.api_check(jr, validationFields)
        else:
            self.api_validated = 'Skipped'
        if self.verb > 3:
            print "{0}Validation passed: {1}\n{0}{2}".format(
                                            " "*3,
                                            self.api_validated,
                                            "_"*30)
def api_verify ( self , url = "https://blockchain.info/rawblock/" , wait = False ) : if self . verb > 3 : print "{0}{1}Validating{1}" . format ( " " * 3 , "_" * 10 ) jr = self . api_get ( url = url , wait = False ) if jr is not None : validationFields = { self . hash : jr [ 'hash' ] , self . blockSize : jr [ 'size' ] , self . merkleRootHash : jr [ 'mrkl_root' ] , self . nTransactions : jr [ 'n_tx' ] , self . prevHash : jr [ 'prev_block' ] , self . nonce : jr [ 'nonce' ] , self . timestamp : jr [ 'time' ] } self . api_validated = self . api_check ( jr , validationFields ) else : self . api_validated = 'Skipped' if self . verb > 3 : print "{0}Validation passed: {1}\n{0}{2}" . format ( " " * 3 , self . api_validated , "_" * 30 )
Query a block hash from Blockchain.info's api.
Query a block hash from Blockchain . info ' s api .
"""
        Query a block hash from Blockchain.info's api. Check it matches the
        blockon size, merkle root, number of transactions, previous block hash

        Respects apis request limting queries to 1 every 10s. If wait is True,
        waits to query. If false, skips.

        TODO:
            - Tidy printing
        """ # Use these fields for validation # Report
self
url
wait