mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-23 19:31:00 +08:00
rename flag 'aggressive_registration' -> 'unsafe' + added information to the api doc
This commit is contained in:
@@ -2112,9 +2112,9 @@ def async_preorder(fqu, payment_privkey_info, owner_privkey_info, cost, name_dat
|
||||
return {'error': 'Failed to sign and broadcast preorder transaction'}
|
||||
|
||||
additionals = {}
|
||||
if 'aggressive_registration' in name_data:
|
||||
if 'unsafe_reg' in name_data:
|
||||
log.debug("Adding an *aggressive* preorder for {}".format(fqu))
|
||||
additionals['aggressive_registration'] = name_data['aggressive_registration']
|
||||
additionals['unsafe_reg'] = name_data['unsafe_reg']
|
||||
additionals['confirmations_needed'] = 4
|
||||
if 'min_payment_confs' in name_data:
|
||||
additionals['min_payment_confs'] = name_data['min_payment_confs']
|
||||
@@ -2194,9 +2194,9 @@ def async_register(fqu, payment_privkey_info, owner_privkey_info, name_data={},
|
||||
# configure registrar with information from the preorder
|
||||
additionals = {}
|
||||
force_register = False
|
||||
if 'aggressive_registration' in name_data:
|
||||
if 'unsafe_reg' in name_data:
|
||||
log.debug("Adding an *aggressive* register for {}".format(fqu))
|
||||
additionals['aggressive_registration'] = name_data['aggressive_registration']
|
||||
additionals['unsafe_reg'] = name_data['unsafe_reg']
|
||||
additionals['confirmations_needed'] = 1
|
||||
force_register = True
|
||||
if 'min_payment_confs' in name_data:
|
||||
@@ -2296,9 +2296,9 @@ def async_update(fqu, zonefile_data, profile, owner_privkey_info, payment_privke
|
||||
additionals = {}
|
||||
force_update = True
|
||||
|
||||
if 'aggressive_registration' in register_data:
|
||||
if 'unsafe_reg' in register_data:
|
||||
log.debug("Adding an *aggressive* update for {}".format(fqu))
|
||||
additionals['aggressive_registration'] = register_data['aggressive_registration']
|
||||
additionals['unsafe_reg'] = register_data['unsafe_reg']
|
||||
additionals['confirmations_needed'] = 1
|
||||
force_update = True
|
||||
|
||||
|
||||
@@ -318,7 +318,7 @@ def queue_append(queue_id, fqu, tx_hash, payment_address=None,
|
||||
owner_address=None, transfer_address=None,
|
||||
config_path=CONFIG_PATH, block_height=None,
|
||||
zonefile_data=None, profile=None, zonefile_hash=None,
|
||||
aggressive_registration = None, confirmations_needed = None,
|
||||
unsafe_reg = None, confirmations_needed = None,
|
||||
min_payment_confs = None, path=DEFAULT_QUEUE_PATH):
|
||||
|
||||
"""
|
||||
@@ -342,8 +342,8 @@ def queue_append(queue_id, fqu, tx_hash, payment_address=None,
|
||||
new_entry['owner_address'] = owner_address
|
||||
new_entry['transfer_address'] = transfer_address
|
||||
|
||||
if aggressive_registration is not None:
|
||||
new_entry['aggressive_registration'] = aggressive_registration
|
||||
if unsafe_reg is not None:
|
||||
new_entry['unsafe_reg'] = unsafe_reg
|
||||
if confirmations_needed is not None:
|
||||
new_entry['confirmations_needed'] = confirmations_needed
|
||||
if min_payment_confs is not None:
|
||||
|
||||
@@ -1145,7 +1145,7 @@ def get_wallet(config_path=None, proxy=None):
|
||||
|
||||
|
||||
# RPC method: backend_preorder
|
||||
def preorder(fqu, cost_satoshis, zonefile_data, profile, transfer_address, min_payment_confs, proxy=None, config_path=CONFIG_PATH, aggressive_registration = False):
|
||||
def preorder(fqu, cost_satoshis, zonefile_data, profile, transfer_address, min_payment_confs, proxy=None, config_path=CONFIG_PATH, unsafe_reg = False):
|
||||
"""
|
||||
Send preorder transaction and enter it in queue.
|
||||
Queue up additional state so we can update and transfer it as well.
|
||||
@@ -1157,7 +1157,7 @@ def preorder(fqu, cost_satoshis, zonefile_data, profile, transfer_address, min_p
|
||||
|
||||
state, config_path, proxy = get_registrar_state(config_path=config_path, proxy=proxy)
|
||||
data = {}
|
||||
if aggressive_registration:
|
||||
if unsafe_reg:
|
||||
log.debug('Aggressive registration of {}'.format(fqu))
|
||||
|
||||
if state.payment_address is None or state.owner_address is None:
|
||||
@@ -1186,9 +1186,9 @@ def preorder(fqu, cost_satoshis, zonefile_data, profile, transfer_address, min_p
|
||||
log.warn("Using {} confirmations instead of the default {}".format(min_payment_confs, TX_MIN_CONFIRMATIONS))
|
||||
name_data['min_payment_confs'] = min_payment_confs # propogate this to later txns
|
||||
|
||||
if aggressive_registration:
|
||||
if unsafe_reg:
|
||||
name_data['confirmations_needed'] = PREORDER_CONFIRMATIONS
|
||||
name_data['aggressive_registration'] = True
|
||||
name_data['unsafe_reg'] = True
|
||||
|
||||
log.debug("async_preorder({}, zonefile_data={}, profile={}, transfer_address={})".format(fqu, zonefile_data, profile, transfer_address))
|
||||
resp = async_preorder(fqu, payment_privkey_info, owner_privkey_info, cost_satoshis,
|
||||
|
||||
Reference in New Issue
Block a user