more work on block headers, PMs now signed/verified

This commit is contained in:
Kevin Froman 2018-04-26 14:56:17 -05:00
parent ad56082271
commit c9b7528db4
No known key found for this signature in database
GPG key ID: 0D414D0FE405B63B
4 changed files with 71 additions and 24 deletions

View file

@ -269,8 +269,8 @@ class Core:
selfInsert = 1
else:
selfInsert = 0
data = (newHash, currentTime, 0, '', 0, selfInsert)
c.execute('INSERT INTO hashes VALUES(?, ?, ?, ?, ?, ?);', data)
data = (newHash, currentTime, '', selfInsert)
c.execute('INSERT INTO hashes (hash, dateReceived, dataType, dataSaved) VALUES(?, ?, ?, ?);', data)
conn.commit()
conn.close()
@ -618,7 +618,7 @@ class Core:
retData = ''
metadata = {'type': header}
if sign:
signature = self._crypto.edSign(data, self._crypto.privKey, encodedResult=True)
signature = self._crypto.edSign(data, self._crypto.privKey, encodeResult=True)
ourID = self._crypto.pubKeyHashID()
metadata['id'] = ourID
metadata['sig'] = signature