more progress in removing onionrutils class

This commit is contained in:
Kevin Froman 2019-06-25 03:21:36 -05:00
parent d378340099
commit 909c002dc4
37 changed files with 164 additions and 189 deletions

View file

@ -1,4 +1,5 @@
import os, sqlite3
import onionrutils
def add_to_block_DB(core_inst, newHash, selfInsert=False, dataSaved=False):
'''
Add a hash value to the block db
@ -8,7 +9,7 @@ def add_to_block_DB(core_inst, newHash, selfInsert=False, dataSaved=False):
if not os.path.exists(core_inst.blockDB):
raise Exception('Block db does not exist')
if core_inst._utils.hasBlock(newHash):
if onionrutils.has_block(core_inst, newHash):
return
conn = sqlite3.connect(core_inst.blockDB, timeout=30)
c = conn.cursor()

View file

@ -10,7 +10,7 @@ def add_peer(core_inst, peerID, name=''):
raise ValueError("specified id is already known")
# This function simply adds a peer to the DB
if not core_inst._utils.validatePubKey(peerID):
if not stringvalidators.validate_pub_key(peerID):
return False
events.event('pubkey_add', data = {'key': peerID}, onionr = core_inst.onionrInst)