X-Git-Url: https://git.novaco.in/?p=electrum-server.git;a=blobdiff_plain;f=backends%2Fbitcoind%2Fblockchain_processor.py;fp=backends%2Fbitcoind%2Fblockchain_processor.py;h=3d93fd89acc54c9c4e6b74ab1ba4f36e4dc0b77c;hp=fb68f255b496b1c54a40bbefb3b7f799f6dfd2bc;hb=0c2cb134a92e720a4527b30d159fabfc0c6e35ef;hpb=c2c3c834de5ff90bea4086455d38328f9e18c0d0 diff --git a/backends/bitcoind/blockchain_processor.py b/backends/bitcoind/blockchain_processor.py index fb68f25..3d93fd8 100644 --- a/backends/bitcoind/blockchain_processor.py +++ b/backends/bitcoind/blockchain_processor.py @@ -235,7 +235,7 @@ class BlockchainProcessor(Processor): vds = deserialize.BCDataStream() vds.write(raw_tx.decode('hex')) try: - return deserialize.parse_Transaction(vds, is_coinbase=False, is_coinstake=False) + return deserialize.parse_Transaction(vds, is_coinbase=False) except: print_log("ERROR: cannot parse", txid) return None @@ -356,23 +356,18 @@ class BlockchainProcessor(Processor): def deserialize_block(self, block): - is_stake_block = False txlist = block.get('tx') - if "proof-of-stake" in block.get('flags'): # scan block flags list for - is_stake_block = True # "proof-of-stake" substring tx_hashes = [] # ordered txids txdict = {} # deserialized tx - for i in xrange(len(txlist)): - if is_stake_block and i == 0: # skip coinbase for - continue # stake block - tx_hash = hash_encode(Hash(txlist[i].decode('hex'))) + for i, raw_tx in enumerate(txlist): + tx_hash = hash_encode(Hash(raw_tx.decode('hex'))) vds = deserialize.BCDataStream() - vds.write(txlist[i].decode('hex')) + vds.write(raw_tx.decode('hex')) try: - tx = deserialize.parse_Transaction(vds, i == 0, is_stake_block and i == 1) # first transaction is always coinbase - except: # second transaction is coinstake if we have a stake block + tx = deserialize.parse_Transaction(vds, i == 0) # first transaction is always coinbase + except: print_log("ERROR: cannot parse", tx_hash) continue tx_hashes.append(tx_hash)