def sign_tx(self, tx, i, priv): if self.my_cj_addr: return btc.sign(tx, i, priv) else: return btc.sign(tx, i, priv, usenonce=btc.safe_from_hex(self.sign_k))
def double_sha256(hex_string): ''' Double sha256. Example: Input: '0100000001294ea156f83627e196b31f8c70597c3b38851c174259bca7c80888ca422c4db8010000001976a914869441d5dc3befb911151d60501d85683483aa9d88acffffffff020a000000000000001976a914f93d302789520e8ca07affb76d4ba4b74ca3b3e688ac3c215200000000001976a914869441d5dc3befb911151d60501d85683483aa9d88ac0000000001000000' Output: 'e147a7e260afbb779db8acd56888aab66232d6136f60a11aeb4c0bb4efacb33c' Uses @vbuterin's safe_from_hex for python2/3 compatibility ''' return sha256(sha256(safe_from_hex(hex_string)).digest()).hexdigest()