mirror of
https://git.wownero.com/wownero/tippero.git
synced 2024-08-15 00:33:14 +00:00
Add a payment id format checker
This commit is contained in:
parent
1e29558c5e
commit
c8b6ade388
1 changed files with 9 additions and 0 deletions
|
@ -15,6 +15,7 @@ import json
|
||||||
import httplib
|
import httplib
|
||||||
import time
|
import time
|
||||||
import math
|
import math
|
||||||
|
import string
|
||||||
from decimal import *
|
from decimal import *
|
||||||
import tipbot.config as config
|
import tipbot.config as config
|
||||||
import tipbot.coinspecs as coinspecs
|
import tipbot.coinspecs as coinspecs
|
||||||
|
@ -80,6 +81,14 @@ def IsValidAddress(address):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def IsValidPaymentID(payment_id):
|
||||||
|
if len(payment_id)!=64:
|
||||||
|
return False
|
||||||
|
for char in payment_id:
|
||||||
|
if char not in string.hexdigits:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
# Code taken from the Python documentation
|
# Code taken from the Python documentation
|
||||||
def moneyfmt(value, places=2, curr='', sep=',', dp='.',
|
def moneyfmt(value, places=2, curr='', sep=',', dp='.',
|
||||||
pos='', neg='-', trailneg=''):
|
pos='', neg='-', trailneg=''):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue