Create block API (todo docs)
This commit is contained in:
parent
e95feb06db
commit
9fdb6d8609
2 changed files with 177 additions and 14 deletions
|
@ -592,6 +592,20 @@ class Core:
|
|||
|
||||
return rows
|
||||
|
||||
def getBlockDate(self, blockHash):
|
||||
'''
|
||||
Returns the date a block was received
|
||||
'''
|
||||
conn = sqlite3.connect(self.blockDB)
|
||||
c = conn.cursor()
|
||||
execute = 'SELECT dateReceived FROM hashes WHERE hash=?;'
|
||||
args = (blockHash,)
|
||||
for row in c.execute(execute, args):
|
||||
for i in row:
|
||||
return int(i)
|
||||
|
||||
return None
|
||||
|
||||
def getBlocksByType(self, blockType):
|
||||
'''
|
||||
Returns a list of blocks by the type
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue