Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 16e74e6

Browse files
committedJan 2, 2019
Merge petertodd#199: add comment on an argument of getblock rpc
18c883b add comment on an argument of getblock rpc (smasuda) Pull request description: I found this while I was looking around the code. "true/false" argument is no longer documented in bitcoin core's rpc, This comment might be helpful for those who look this in detail. We could change the argument to be 0 instead of false, however, it would break if someone is using bitcoin-core before v0.15.0. Tree-SHA512: b698fa059c42ebc894c2436622a6c1965d87000fefe505d01c37eba13ef0a746a215330772aa638c0757d9acc17a86d550314dd50a4e2a938e19c878ee2166f2
2 parents 73110cb + 18c883b commit 16e74e6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎bitcoin/rpc.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,9 @@ def getblock(self, block_hash):
449449
raise TypeError('%s.getblock(): block_hash must be bytes; got %r instance' %
450450
(self.__class__.__name__, block_hash.__class__))
451451
try:
452+
# With this change ( https://github.com/bitcoin/bitcoin/commit/96c850c20913b191cff9f66fedbb68812b1a41ea#diff-a0c8f511d90e83aa9b5857e819ced344 ),
453+
# bitcoin core's rpc takes 0/1/2 instead of true/false as the 2nd argument which specifies verbosity, since v0.15.0.
454+
# The change above is backward-compatible so far; the old "false" is taken as the new "0".
452455
r = self._call('getblock', block_hash, False)
453456
except InvalidAddressOrKeyError as ex:
454457
raise IndexError('%s.getblock(): %s (%d)' %

0 commit comments

Comments
 (0)
Failed to load comments.