use new price table for namespace price calculation

This commit is contained in:
Jude Nelson
2017-09-20 18:08:48 -04:00
parent 28b2e49c37
commit a447cabb3e

View File

@@ -151,20 +151,11 @@ def price_namespace( namespace_id, block_height ):
"""
Calculate the cost of a namespace.
"""
price_table = get_epoch_namespace_prices( block_height )
if len(namespace_id) >= len(price_table):
return price_table[0]
price_multiplier = get_epoch_price_multiplier( block_height, namespace_id )
if len(namespace_id) == 1:
return NAMESPACE_1_CHAR_COST * price_multiplier
elif len(namespace_id) in [2, 3]:
return NAMESPACE_23_CHAR_COST * price_multiplier
elif len(namespace_id) in [4, 5, 6, 7]:
return NAMESPACE_4567_CHAR_COST * price_multiplier
else:
return NAMESPACE_8UP_CHAR_COST * price_multiplier
return price_table[len(namespace_id)]
def find_by_opcode( checked_ops, opcode ):
@@ -225,6 +216,10 @@ def get_public_key_hex_from_tx( inputs, address ):
find the public key.
This only works for p2pkh scripts.
We only really need this for NAMESPACE_REVEAL, but we included
it in other transactions' consensus data for legacy reasons that
now have to be supported forever :(
"""
ret = None