def easy_add_transaction(tx_orig, privkey, DB): tx = copy.deepcopy(tx_orig) pubkey = pt.privtopub(privkey) try: tx['count'] = blockchain.count(pubkey, DB) except: tx['count'] = 1 tx['signature'] = pt.ecdsa_sign(tools.det_hash(tx), privkey) blockchain.add_tx(tx, DB)
def sign(msg, privkey): return pt.ecdsa_sign(msg, privkey) def verify(msg, sig, pubkey): return pt.ecdsa_verify(msg, sig, pubkey)
def sign(msg, privkey): return pt.ecdsa_sign(msg, privkey)