diff options
author | Jeff Garzik <jgarzik@bitpay.com> | 2014-01-12 11:31:43 -0800 |
---|---|---|
committer | Jeff Garzik <jgarzik@bitpay.com> | 2014-01-12 11:31:43 -0800 |
commit | be2fb2d603476d7490279cf6db034adf1dee6dd3 (patch) | |
tree | 263955c56ecf74715b1bfaa194317f8879e42505 | |
parent | 0e469b516770ebfb6596cf71532a8c9c233527ca (diff) | |
parent | 7a29fb59405e32b6274ad1830687e936cab1999f (diff) |
Merge pull request #3518 from Michagogo/linearize-start-value
Tweak linearize.py to give more flexibility
-rw-r--r-- | contrib/linearize/linearize.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/linearize/linearize.py b/contrib/linearize/linearize.py index 2d8509f83c..12049100dc 100644 --- a/contrib/linearize/linearize.py +++ b/contrib/linearize/linearize.py @@ -73,9 +73,9 @@ def get_blocks(settings): rpc = BitcoinRPC(settings['host'], settings['port'], 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) outhdr = settings['netmagic'] @@ -114,6 +114,8 @@ if __name__ == '__main__': settings['host'] = '127.0.0.1' if 'port' not in settings: settings['port'] = 8332 + if 'min_height' not in settings: + settings['min_height'] = 0 if 'max_height' not in settings: settings['max_height'] = 250000 if 'rpcuser' not in settings or 'rpcpass' not in settings: @@ -122,6 +124,7 @@ if __name__ == '__main__': settings['netmagic'] = settings['netmagic'].decode('hex') settings['port'] = int(settings['port']) + settings['min_height'] = int(settings['min_height']) settings['max_height'] = int(settings['max_height']) get_blocks(settings) |