Skip to content

Commit

Permalink
Fix for litecoin block sending
Browse files Browse the repository at this point in the history
Use getblocktemplate instead of submitblock for litecoin node
  • Loading branch information
Rav3nPL committed Mar 19, 2013
1 parent 77e7e2a commit d2e2257
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions p2pool/bitcoin/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,12 @@ def submit_block_p2p(block, factory, net):
@defer.inlineCallbacks
def submit_block_rpc(block, ignore_failure, bitcoind, bitcoind_work, net):
if bitcoind_work.value['use_getblocktemplate']:
result = yield bitcoind.rpc_submitblock(bitcoin_data.block_type.pack(block).encode('hex'))
success = result is None
if 'lite' in self.node.net.NAME:
result = yield bitcoind.rpc_getblocktemplate(dict(mode='submit', data=bitcoin_data.block_type.pack(block).encode('hex')))
success = result is None
else:
result = yield bitcoind.rpc_submitblock(bitcoin_data.block_type.pack(block).encode('hex'))
success = result is None
else:
result = yield bitcoind.rpc_getmemorypool(bitcoin_data.block_type.pack(block).encode('hex'))
success = result
Expand Down

0 comments on commit d2e2257

Please sign in to comment.