Permalink
Browse files

Fix for litecoin block sending

Use getblocktemplate instead of submitblock for litecoin node
  • Loading branch information...
1 parent 77e7e2a commit d2e2257e959812186f0c78384decb37d8181c4d4 @Rav3nPL Rav3nPL committed Mar 19, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 p2pool/bitcoin/helper.py
View
@@ -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

0 comments on commit d2e2257

Please sign in to comment.