fix #1728
This commit is contained in:
@@ -216,6 +216,7 @@ class Commands:
|
||||
@command('wp')
|
||||
def signtransaction(self, tx, privkey=None):
|
||||
"""Sign a transaction. The wallet keys will be used unless a private key is provided."""
|
||||
tx = Transaction(tx)
|
||||
if privkey:
|
||||
pubkey = bitcoin.public_key_from_private_key(privkey)
|
||||
h160 = bitcoin.hash_160(pubkey.decode('hex'))
|
||||
@@ -228,11 +229,13 @@ class Commands:
|
||||
@command('')
|
||||
def deserialize(self, tx):
|
||||
"""Deserialize a serialized transaction"""
|
||||
tx = Transaction(tx)
|
||||
return tx.deserialize()
|
||||
|
||||
@command('n')
|
||||
def broadcast(self, tx, timeout=30):
|
||||
"""Broadcast a transaction to the network. """
|
||||
tx = Transaction(tx)
|
||||
return self.network.broadcast(tx, timeout)
|
||||
|
||||
@command('')
|
||||
|
||||
@@ -872,8 +872,7 @@ def tx_from_str(txt):
|
||||
except:
|
||||
is_hex = False
|
||||
if is_hex:
|
||||
return Transaction(txt)
|
||||
return txt
|
||||
tx_dict = json.loads(str(txt))
|
||||
assert "hex" in tx_dict.keys()
|
||||
tx = Transaction(tx_dict["hex"])
|
||||
return tx
|
||||
return tx_dict["hex"]
|
||||
|
||||
Reference in New Issue
Block a user