X-Git-Url: https://git.novaco.in/?p=electrum-server.git;a=blobdiff_plain;f=backends%2Fbitcoind%2Fblockchain_processor.py;h=5dfecb8146474d3bcedec2e52ae488215f996930;hp=96204018afab029ec6cedb259eaaba26a23c1900;hb=417831a761f7d61e7b84e3fff1a153fc54570372;hpb=cba8b52ddd13b4183f2a26ed96257ffdf55ef615 diff --git a/backends/bitcoind/blockchain_processor.py b/backends/bitcoind/blockchain_processor.py index 9620401..5dfecb8 100644 --- a/backends/bitcoind/blockchain_processor.py +++ b/backends/bitcoind/blockchain_processor.py @@ -217,11 +217,15 @@ class BlockchainProcessor(Processor): return chunk - def get_transaction(self, txid, block_height=-1, is_coinbase = False): - raw_tx = self.bitcoind('getrawtransaction', [txid, 0, block_height]) + def get_mempool_transaction(self, txid): + try: + raw_tx = self.bitcoind('getrawtransaction', [txid, 0, -1]) + except: + return None + vds = deserialize.BCDataStream() vds.write(raw_tx.decode('hex')) - out = deserialize.parse_Transaction(vds, is_coinbase) + out = deserialize.parse_Transaction(vds, is_coinbase = False) return out @@ -705,7 +709,7 @@ class BlockchainProcessor(Processor): for tx_hash in mempool_hashes: if tx_hash in self.mempool_hashes: continue - tx = self.get_transaction(tx_hash) + tx = self.get_mempool_transaction(tx_hash) if not tx: continue for x in tx.get('inputs'):