mirror of
https://git.wownero.com/wownero/tippero.git
synced 2024-08-15 00:33:14 +00:00
Allow integrated addresses
This commit is contained in:
parent
fe98e9f549
commit
2d324d6415
2 changed files with 12 additions and 2 deletions
|
@ -15,7 +15,7 @@ coinspecs = {
|
|||
"symbol": "XMR",
|
||||
"atomic_units": 1e12,
|
||||
"denominations": [[1000000, 1, "piconero"], [1000000000, 1e6, "micronero"], [1000000000000, 1e9, "millinero"]],
|
||||
"address_length": [95, 95], # min/max size of addresses
|
||||
"address_length": [[95, 95], [106, 106]], # min/max size of addresses
|
||||
"address_prefix": ['4', '9'], # allowed prefixes of addresses
|
||||
"min_withdrawal_fee": 10000000000,
|
||||
"web_wallet_url": "https://mymonero.com/", # None is there's none
|
||||
|
|
|
@ -76,8 +76,18 @@ def GetIdentityFromPaymentID(p):
|
|||
identity = "freenode:"+identity
|
||||
return identity
|
||||
|
||||
def IsAddressLengthValid(address):
|
||||
if type(coinspecs.address_length[0]) == list:
|
||||
for allist in coinspecs.address_length:
|
||||
if len(address) >= allist[0] and len(address) <= allist[1]:
|
||||
return True
|
||||
else:
|
||||
if len(address) >= coinspecs.address_length[0] and len(address) <= coinspecs.address_length[1]:
|
||||
return True
|
||||
return False
|
||||
|
||||
def IsValidAddress(address):
|
||||
if len(address) < coinspecs.address_length[0] or len(address) > coinspecs.address_length[1]:
|
||||
if not IsAddressLengthValid(address):
|
||||
return False
|
||||
for prefix in coinspecs.address_prefix:
|
||||
if address.startswith(prefix):
|
||||
|
|
Loading…
Reference in a new issue