- Https://EggPool.net
This file contains 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
# never remove the str() conversion in data evaluation or database inserts or you will debug for 14 days as signed types mismatch | |
# if you raise in the server thread, the server will die and node will stop | |
# never use codecs, they are bugged and do not provide proper serialization | |
# must unify node and client now that connections parameters are function parameters | |
# if you have a block of data and want to insert it into sqlite, you must use a single "commit" for the whole batch, it's 100x faster | |
# do not isolation_level=None/WAL hdd levels, it makes saving slow | |
VERSION = "4.2.5.4R" # 4.2.5.4 + rollbacks hooks |
This file contains 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
def difficulty(c): | |
execute(c, "SELECT block_height, timestamp FROM transactions WHERE reward != 0 ORDER BY block_height DESC LIMIT 2") | |
block_height, timestamp_last = c.fetchone() | |
timestamp_before_last = c.fetchone()[1] | |
execute_param(c, "SELECT timestamp FROM transactions WHERE block_height > ? AND reward != 0 ORDER BY timestamp ASC LIMIT 2", (block_height - 1441,)) | |
timestamp_1441 = c.fetchone()[0] | |
block_time_prev = (timestamp_before_last - timestamp_1441) / 1440 | |
timestamp_1440 = c.fetchone()[0] | |
block_time = (timestamp_last - timestamp_1440) / 1440 |
This file contains 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
mining_hash = bin_convert(hashlib.sha224((miner_address + nonce + db_block_hash) | |
.encode("utf-8")).hexdigest()) | |
diff_drop_time = 180 | |
mining_condition = bin_convert(db_block_hash)[:diff] | |
if mining_condition in mining_hash: # simplified comparison, no backwards mining | |
app_log.info("Difficulty requirement satisfied for block {} from {}".format (block_height_new, peer_ip)) | |
diff_save = diff | |
# Tail Removal Condition Check Starts Here |
This file contains 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
# add manual refresh, objectify | |
# icons created using http://www.winterdrache.de/freeware/png2ico/ | |
# import sqlite3 | |
import PIL.Image, PIL.ImageTk, pyqrcode, os, time, socks, ast, options, tarfile, essentials, platform | |
import hashlib, base64, icons, log, glob, re | |
# import connections | |
from tokensv2 import * |
This file contains 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
""" | |
Async TCP Client for Bismuth Wallet | |
Eggdrasyl | |
Bismuth Foundation | |
July 2018 | |
""" | |
This file contains 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
"""Python implementation of an Ascii85 encoding | |
See https://en.wikipedia.org/wiki/Ascii85 | |
Uses classic Ascii85 Algorithm, but a custom alphabet to be used as part of a bismuth bis:// url or json string. | |
(no / \ " ') | |
Inspiration from PyZMQ, BSD Licence | |
Data length to encode must be a multiple of 4, padding with non significant char of #0 has to be added if needed. |
NewerOlder