registrar now skips issuing a TRANSFER if the name registration was done on behalf of the current owner. added test case for this.

This commit is contained in:
Aaron Blankstein
2017-07-01 17:45:05 -04:00
parent 75815d7325
commit be48e1d227
2 changed files with 329 additions and 3 deletions

View File

@@ -588,11 +588,19 @@ class RegistrarWorker(threading.Thread):
continue
if update.get("transfer_address") is not None:
log.debug("Transfer {} to {}".format(update['fqu'], update['transfer_address']))
# let's see if the name already got there!
name_rec = get_name_blockchain_record( update['fqu'], proxy=proxy )
if 'address' in name_rec and name_rec['address'] == update['transfer_address']:
log.debug("Requested Transfer {} to {} is owned by {} already. Declaring victory.".format(
update['fqu'], update['transfer_address'], name_rec['address']))
res = { 'success' : True }
else:
log.debug("Transfer {} to {}".format(update['fqu'], update['transfer_address']))
res = transfer( update['fqu'], update['transfer_address'], config_path=config_path, proxy=proxy )
res = transfer( update['fqu'], update['transfer_address'], config_path=config_path, proxy=proxy )
assert 'success' in res
if res['success']:
# clear from update queue
log.debug("Clearing successful transfer of {} to {} from update queue".format(update['fqu'], update['transfer_address']))