mirror of
https://git.wownero.com/lza_menace/wownero-python.git
synced 2024-08-15 03:25:25 +00:00
Add range check
This commit is contained in:
parent
b0526972bd
commit
3b832040c6
2 changed files with 11 additions and 0 deletions
|
@ -199,6 +199,11 @@ class Wallet(object):
|
|||
|
||||
:rtype: :class:`BaseAddress <monero.address.BaseAddress>`
|
||||
"""
|
||||
# ensure indexes are within uint32
|
||||
if major < 0 or major >= 2**32:
|
||||
raise ValueError('major index {} is outside uint32 range'.format(major))
|
||||
if minor < 0 or minor >= 2**32:
|
||||
raise ValueError('minor index {} is outside uint32 range'.format(minor))
|
||||
master_address = self.address()
|
||||
if major == minor == 0:
|
||||
return master_address
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue