Clarify truncation behaviour of get_chunk in docs
This commit is contained in:
parent
49ee008346
commit
7823129526
@ -388,7 +388,10 @@ bandwidth-intensive request.
|
|||||||
**Response**
|
**Response**
|
||||||
|
|
||||||
The binary block headers, as hexadecimal strings, in order
|
The binary block headers, as hexadecimal strings, in order
|
||||||
concatenated together.
|
concatenated together. As many as headers as are available at
|
||||||
|
starting height 2016 * index will be returned; this may range from
|
||||||
|
0 to 2016.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
blockchain.estimatefee
|
blockchain.estimatefee
|
||||||
|
|||||||
@ -254,6 +254,26 @@ class ElectrumX(SessionBase):
|
|||||||
'''Returns a dictionary of server features.'''
|
'''Returns a dictionary of server features.'''
|
||||||
return self.env.server_features()
|
return self.env.server_features()
|
||||||
|
|
||||||
|
def block_headers(self, start_height, count):
|
||||||
|
'''Return concatenated block headers as hex for the main chain;
|
||||||
|
count headers starting at start_height.
|
||||||
|
|
||||||
|
start_height and count must be non-negative integers.'''
|
||||||
|
start_height = self.controller.non_negative_integer(start_height)
|
||||||
|
count = self.controller.non_negative_integer(count)
|
||||||
|
return self.controller.block_headers(start_height, count).hex()
|
||||||
|
|
||||||
|
def block_get_chunk(self, index):
|
||||||
|
'''Return a chunk of block headers as a hexadecimal string.
|
||||||
|
|
||||||
|
index: the chunk index'''
|
||||||
|
index = self.controller.non_negative_integer(index)
|
||||||
|
chunk_size = self.coin.CHUNK_SIZE
|
||||||
|
start_height = index * chunk_size
|
||||||
|
count = chunk_size
|
||||||
|
|
||||||
|
return self.controller.block_headers(start_height, count).hex()
|
||||||
|
|
||||||
def block_get_chunk(self, index):
|
def block_get_chunk(self, index):
|
||||||
'''Return a chunk of block headers as a hexadecimal string.
|
'''Return a chunk of block headers as a hexadecimal string.
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user