@@ -73,9 +73,9 @@ def get_blocks(settings):
73
73
rpc = BitcoinRPC (settings ['host' ], settings ['port' ],
74
74
settings ['rpcuser' ], settings ['rpcpass' ])
75
75
76
- outf = open (settings ['output' ], 'wb ' )
76
+ outf = open (settings ['output' ], 'ab ' )
77
77
78
- for height in xrange (settings ['max_height' ]+ 1 ):
78
+ for height in xrange (settings ['min_height' ], settings [ ' max_height' ]+ 1 ):
79
79
data = getblock (rpc , settings , height )
80
80
81
81
outhdr = settings ['netmagic' ]
@@ -114,6 +114,8 @@ def get_blocks(settings):
114
114
settings ['host' ] = '127.0.0.1'
115
115
if 'port' not in settings :
116
116
settings ['port' ] = 8332
117
+ if 'min_height' not in settings :
118
+ settings ['min_height' ] = 0
117
119
if 'max_height' not in settings :
118
120
settings ['max_height' ] = 250000
119
121
if 'rpcuser' not in settings or 'rpcpass' not in settings :
@@ -122,6 +124,7 @@ def get_blocks(settings):
122
124
123
125
settings ['netmagic' ] = settings ['netmagic' ].decode ('hex' )
124
126
settings ['port' ] = int (settings ['port' ])
127
+ settings ['min_height' ] = int (settings ['min_height' ])
125
128
settings ['max_height' ] = int (settings ['max_height' ])
126
129
127
130
get_blocks (settings )
0 commit comments