Onionr/onionr/coredb/blockmetadb/updateblockinfo.py
Kevin Froman 50e93f46e4 * Major core refactoring
* renamed clandestine to esoteric
2019-06-22 16:16:12 -05:00

13 lines
445 B
Python

import sqlite3
def update_block_info(core_inst, hash, key, data):
if key not in ('dateReceived', 'decrypted', 'dataType', 'dataFound', 'dataSaved', 'sig', 'author', 'dateClaimed', 'expire'):
return False
conn = sqlite3.connect(core_inst.blockDB, timeout=30)
c = conn.cursor()
args = (data, hash)
c.execute("UPDATE hashes SET " + key + " = ? where hash = ?;", args)
conn.commit()
conn.close()
return True