use database timeout in hasblock
This commit is contained in:
parent
304df0fbb4
commit
49ecffb245
@ -21,12 +21,13 @@ import sqlite3
|
||||
from coredb import dbfiles
|
||||
import onionrexceptions
|
||||
from .. import stringvalidators
|
||||
from etc import onionrvalues
|
||||
|
||||
def has_block(hash: str) -> bool:
|
||||
'''
|
||||
Check for new block in the block meta db
|
||||
'''
|
||||
conn = sqlite3.connect(dbfiles.block_meta_db)
|
||||
conn = sqlite3.connect(dbfiles.block_meta_db, timeout=onionrvalues.DATABASE_LOCK_TIMEOUT)
|
||||
c = conn.cursor()
|
||||
if not stringvalidators.validate_hash(hash):
|
||||
raise onionrexceptions.InvalidHexHash("Invalid hash")
|
||||
|
Loading…
Reference in New Issue
Block a user