Last active
August 17, 2017 16:45
-
-
Save Aareon/e8cbbaf5e453f7e8d854a65bb4957ef6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sqlite3 | |
| def get_block(): | |
| conn = sqlite3.connect("static/ledger.db") # open to select the last tx to create a new hash from | |
| conn.text_factory = str | |
| c = conn.cursor() | |
| c.execute("SELECT timestamp,block_height FROM transactions WHERE reward = 10 and block_height >= 20000") | |
| return c.fetchall() | |
| if __name__ == "__main__": | |
| l = [] | |
| y = 0 | |
| result = get_block() | |
| for x in result: | |
| ts_difference = float(x[0]) - float(y) | |
| print("{} {}".format(x[1], ts_difference)) | |
| l.append(ts_difference) | |
| y = x[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, this can be merged, script is outdated, we need to change "reward = 10" to "reward != 0" too