small fixes and work on tests

This commit is contained in:
Kevin Froman 2019-02-19 16:14:06 -06:00
parent a05a391b7e
commit ee5c620cc6
5 changed files with 55 additions and 40 deletions

View file

@ -190,17 +190,3 @@ class OnionrUser:
conn.commit()
conn.close()
return
def findAndSetID(self):
'''Find any info about the user from existing blocks and cache it to their DB entry'''
infoBlocks = []
for bHash in self._core.getBlocksByType('userInfo'):
block = onionrblockapi.Block(bHash, core=self._core)
if block.signer == self.publicKey:
if block.verifySig():
newName = block.getMetadata('name')
if newName.isalnum():
logger.info('%s is now using the name %s.' % (self.publicKey, self._core._utils.escapeAnsi(newName)))
self._core.setPeerInfo(self.publicKey, 'name', newName)
else:
raise onionrexceptions.InvalidPubkey