add_input, sign_input bug fix (private_key store)

This commit is contained in:
Aleksey Karpov 2018-11-27 00:34:44 +04:00 committed by GitHub
parent b138e58ed1
commit 7f1e942114
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -468,7 +468,7 @@ class Transaction(dict):
if amount:
self["vIn"][k]["value"] = amount
if private_key:
self["vIn"][k].private_key = private_key
self["vIn"][k]["private_key"] = private_key
if self.auto_commit:
self.commit()
return self
@ -564,7 +564,7 @@ class Transaction(dict):
# private key
if not private_key:
try:
private_key = self["vIn"][n].private_key.key
private_key = self["vIn"][n]["private_key"].key
except:
raise RuntimeError("no private key")
if isinstance(private_key, list):