Skip to content

Commit

Permalink
Don't mine txs with unconfirmed parents
Browse files Browse the repository at this point in the history
Reduces risk of creating invalid blocks
  • Loading branch information
veqtrus committed Dec 28, 2017
1 parent 98c2039 commit fa52b11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p2pool/bitcoin/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def go():
except jsonrpc.Error_for_code(-32601): # Method not found
print >>sys.stderr, 'Error: Bitcoin version too old! Upgrade to v0.5 or newer!'
raise deferral.RetrySilentlyException()
packed_transactions = [(x['data'] if isinstance(x, dict) else x).decode('hex') for x in work['transactions']]
packed_transactions = [x['data'].decode('hex') for x in work['transactions'] if len(x.get('depends', [])) == 0]
if 'height' not in work:
work['height'] = (yield bitcoind.rpc_getblock(work['previousblockhash']))['height'] + 1
elif p2pool.DEBUG:
Expand Down

0 comments on commit fa52b11

Please sign in to comment.