Allow integrated addresses
This commit is contained in:
parent
fe98e9f549
commit
2d324d6415
|
@ -15,7 +15,7 @@ coinspecs = {
|
||||||
"symbol": "XMR",
|
"symbol": "XMR",
|
||||||
"atomic_units": 1e12,
|
"atomic_units": 1e12,
|
||||||
"denominations": [[1000000, 1, "piconero"], [1000000000, 1e6, "micronero"], [1000000000000, 1e9, "millinero"]],
|
"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
|
"address_prefix": ['4', '9'], # allowed prefixes of addresses
|
||||||
"min_withdrawal_fee": 10000000000,
|
"min_withdrawal_fee": 10000000000,
|
||||||
"web_wallet_url": "https://mymonero.com/", # None is there's none
|
"web_wallet_url": "https://mymonero.com/", # None is there's none
|
||||||
|
|
|
@ -76,8 +76,18 @@ def GetIdentityFromPaymentID(p):
|
||||||
identity = "freenode:"+identity
|
identity = "freenode:"+identity
|
||||||
return 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):
|
def IsValidAddress(address):
|
||||||
if len(address) < coinspecs.address_length[0] or len(address) > coinspecs.address_length[1]:
|
if not IsAddressLengthValid(address):
|
||||||
return False
|
return False
|
||||||
for prefix in coinspecs.address_prefix:
|
for prefix in coinspecs.address_prefix:
|
||||||
if address.startswith(prefix):
|
if address.startswith(prefix):
|
||||||
|
|
Loading…
Reference in New Issue