Skip to content

Commit 8d6d739

Browse files
committed
rpc: wrapper for getblockcount
1 parent 47b87a5 commit 8d6d739

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

bitcoin/rpc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,10 @@ def getblock(self, block_hash):
323323
(self.__class__.__name__, ex.error['message'], ex.error['code']))
324324
return CBlock.deserialize(unhexlify(r))
325325

326+
def getblockcount(self):
327+
"""Return the number of blocks in the longest block chain"""
328+
return self._call('getblockcount')
329+
326330
def getblockhash(self, height):
327331
"""Return hash of block in best-block-chain at height.
328332

release-notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Breaking API changes:
1212

1313
New features:
1414

15-
* New RPC calls: getbestblockhash, getmininginfo
15+
* New RPC calls: getbestblockhash, getblockcount, getmininginfo
1616

1717
v0.4.0
1818
======

0 commit comments

Comments
 (0)