'bitcoinaddress' in (yield bitcoind.rpc_help()) and
not (yield bitcoind.rpc_getinfo())['testnet']
)),
+ SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//210000,
POW_FUNC=data.hash256,
BLOCK_PERIOD=600, # s
SYMBOL='BTC',
'bitcoinaddress' in (yield bitcoind.rpc_help()) and
(yield bitcoind.rpc_getinfo())['testnet']
)),
+ SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//210000,
POW_FUNC=data.hash256,
BLOCK_PERIOD=600, # s
SYMBOL='tBTC',
'namecoinaddress' in (yield bitcoind.rpc_help()) and
not (yield bitcoind.rpc_getinfo())['testnet']
)),
+ SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//210000,
POW_FUNC=data.hash256,
BLOCK_PERIOD=600, # s
SYMBOL='NMC',
'namecoinaddress' in (yield bitcoind.rpc_help()) and
(yield bitcoind.rpc_getinfo())['testnet']
)),
+ SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//210000,
POW_FUNC=data.hash256,
BLOCK_PERIOD=600, # s
SYMBOL='tNMC',
'litecoinaddress' in (yield bitcoind.rpc_help()) and
not (yield bitcoind.rpc_getinfo())['testnet']
)),
+ SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//840000,
POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
BLOCK_PERIOD=150, # s
SYMBOL='LTC',
'litecoinaddress' in (yield bitcoind.rpc_help()) and
(yield bitcoind.rpc_getinfo())['testnet']
)),
+ SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//840000,
POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
BLOCK_PERIOD=150, # s
SYMBOL='tLTC',
raise deferral.RetrySilentlyException()
defer.returnValue(temp_work)
temp_work = yield check()
+
+ block_height_var = variable.Variable(None)
+ @defer.inlineCallbacks
+ def poll_height():
+ block_height_var.set((yield deferral.retry('Error while calling getblockcount:')(bitcoind.rpc_getblockcount)()))
+ yield poll_height()
+ task.LoopingCall(poll_height).start(60*60)
+
print ' ...success!'
print ' Current block hash: %x' % (temp_work['previous_block_hash'],)
+ print ' Current block height: %i' % (block_height_var.value,)
print
# connect to bitcoind over bitcoin-p2p
time=best_block_header.value['timestamp'] + 600, # better way?
transactions=[],
merkle_link=bitcoin_data.calculate_merkle_link([0], 0),
- subsidy=5000000000, # XXX fix this
+ subsidy=net.PARENT.SUBSIDY_FUNC(block_height_var.value),
clock_offset=current_work.value['clock_offset'],
last_update=current_work.value['last_update'],
)