def _get_value_for_name(self, name): block_header = self.network.blockchain.read_header( self.network.get_local_height() - RECOMMENDED_CLAIMTRIE_HASH_CONFIRMS + 1) block_hash = self.network.blockchain.hash_header(block_header) d = self._run_cmd_as_defer_to_thread('requestvalueforname', name, block_hash) d.addCallback(lambda response: Commands._verify_proof(name, block_header['claim_trie_root'], response)) return d
def _get_value_for_name(self, name): block_header = self.network.blockchain.read_header( self.network.get_local_height() - RECOMMENDED_CLAIMTRIE_HASH_CONFIRMS + 1) block_hash = self.network.blockchain.hash_header(block_header) d = self._run_cmd_as_defer_to_thread('requestvalueforname', name, block_hash) d.addCallback(lambda response: Commands._verify_proof( name, block_header['claim_trie_root'], response)) return d
def _get_value_for_name(self, name): height_to_check = self.network.get_local_height() - RECOMMENDED_CLAIMTRIE_HASH_CONFIRMS + 1 if height_to_check < 0: msg = "Height to check is less than 0, blockchain headers are likely not initialized" raise Exception(msg) block_header = self.network.blockchain.read_header(height_to_check) block_hash = self.network.blockchain.hash_header(block_header) d = self._run_cmd_as_defer_to_thread('requestvalueforname', name, block_hash) d.addCallback(lambda response: Commands._verify_proof(name, block_header['claim_trie_root'], response)) return d