def get_mempool_transaction(self, txid):
        try:
            raw_tx = self.lbrycrdd('getrawtransaction', (txid, 0))
        except:
            print_log("Error looking up txid: %s" % txid)
            return None

        vds = deserialize.BCDataStream()
        vds.write(raw_tx.decode('hex'))
        try:
            return deserialize.parse_Transaction(vds, is_coinbase=False)
        except:
            print_log("ERROR: cannot parse", txid)
            return None
    def get_mempool_transaction(self, txid):
        try:
            raw_tx = self.lbrycrdd('getrawtransaction', (txid, 0))
        except:
            print_log("Error looking up txid: %s" % txid)
            return None

        vds = deserialize.BCDataStream()
        vds.write(raw_tx.decode('hex'))
        try:
            return deserialize.parse_Transaction(vds, is_coinbase=False)
        except:
            print_log("ERROR: cannot parse", txid)
            return None
 def deserialize_block(block):
     txlist = block.get('tx')
     tx_hashes = []  # ordered txids
     txdict = {}  # deserialized tx
     is_coinbase = True
     for raw_tx in txlist:
         tx_hash = hash_encode(Hash(raw_tx.decode('hex')))
         vds = deserialize.BCDataStream()
         vds.write(raw_tx.decode('hex'))
         try:
             tx = deserialize.parse_Transaction(vds, is_coinbase)
         except:
             print_log("ERROR: cannot parse", tx_hash)
             continue
         tx_hashes.append(tx_hash)
         txdict[tx_hash] = tx
         is_coinbase = False
     return tx_hashes, txdict
 def deserialize_block(block):
     txlist = block.get('tx')
     tx_hashes = []  # ordered txids
     txdict = {}  # deserialized tx
     is_coinbase = True
     for raw_tx in txlist:
         tx_hash = hash_encode(Hash(raw_tx.decode('hex')))
         vds = deserialize.BCDataStream()
         vds.write(raw_tx.decode('hex'))
         try:
             tx = deserialize.parse_Transaction(vds, is_coinbase)
         except:
             print_log("ERROR: cannot parse", tx_hash)
             continue
         tx_hashes.append(tx_hash)
         txdict[tx_hash] = tx
         is_coinbase = False
     return tx_hashes, txdict
Beispiel #5
0
def deserialize_raw_tx(raw_tx):
    vds = deserialize.BCDataStream()
    vds.write(raw_tx.decode('hex'))
    return deserialize.parse_Transaction(vds, is_coinbase=False)
def deserialize_raw_tx(raw_tx):
    vds = deserialize.BCDataStream()
    vds.write(raw_tx.decode('hex'))
    return deserialize.parse_Transaction(vds, is_coinbase=False)