mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-17 18:40:09 +00:00
Merge pull request #3518 from Michagogo/linearize-start-value
Tweak linearize.py to give more flexibility
This commit is contained in:
commit
be2fb2d603
@ -73,9 +73,9 @@ def get_blocks(settings):
|
|||||||
rpc = BitcoinRPC(settings['host'], settings['port'],
|
rpc = BitcoinRPC(settings['host'], settings['port'],
|
||||||
settings['rpcuser'], settings['rpcpass'])
|
settings['rpcuser'], settings['rpcpass'])
|
||||||
|
|
||||||
outf = open(settings['output'], 'wb')
|
outf = open(settings['output'], 'ab')
|
||||||
|
|
||||||
for height in xrange(settings['max_height']+1):
|
for height in xrange(settings['min_height'], settings['max_height']+1):
|
||||||
data = getblock(rpc, settings, height)
|
data = getblock(rpc, settings, height)
|
||||||
|
|
||||||
outhdr = settings['netmagic']
|
outhdr = settings['netmagic']
|
||||||
@ -114,6 +114,8 @@ if __name__ == '__main__':
|
|||||||
settings['host'] = '127.0.0.1'
|
settings['host'] = '127.0.0.1'
|
||||||
if 'port' not in settings:
|
if 'port' not in settings:
|
||||||
settings['port'] = 8332
|
settings['port'] = 8332
|
||||||
|
if 'min_height' not in settings:
|
||||||
|
settings['min_height'] = 0
|
||||||
if 'max_height' not in settings:
|
if 'max_height' not in settings:
|
||||||
settings['max_height'] = 250000
|
settings['max_height'] = 250000
|
||||||
if 'rpcuser' not in settings or 'rpcpass' not in settings:
|
if 'rpcuser' not in settings or 'rpcpass' not in settings:
|
||||||
@ -122,6 +124,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
settings['netmagic'] = settings['netmagic'].decode('hex')
|
settings['netmagic'] = settings['netmagic'].decode('hex')
|
||||||
settings['port'] = int(settings['port'])
|
settings['port'] = int(settings['port'])
|
||||||
|
settings['min_height'] = int(settings['min_height'])
|
||||||
settings['max_height'] = int(settings['max_height'])
|
settings['max_height'] = int(settings['max_height'])
|
||||||
|
|
||||||
get_blocks(settings)
|
get_blocks(settings)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user