Skip to content
This repository has been archived by the owner on May 6, 2023. It is now read-only.

Commit

Permalink
implement full functionality of the signrawtransaction
Browse files Browse the repository at this point in the history
  • Loading branch information
peerchemist committed Apr 2, 2019
1 parent 268163e commit f84e440
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions peercoin_rpc/peercoin_rpc.py
Expand Up @@ -234,9 +234,21 @@ def decoderawtransaction(self, txhash):
'''dump the transaction draft'''
return self.req("decoderawtransaction", [txhash])

def signrawtransaction(self, rawtxhash):
'''signrawtransaction with privkey, returns status and rawtxhash'''
return self.req("signrawtransaction", [rawtxhash])
def signrawtransaction(self,
rawtxhash,
parent_tx_outputs=None,
private_key=None):
'''signrawtransaction returns status and rawtxhash
: rawtxhash - serialized transaction (hex)
: parent_tx_outputs - outputs being spent by this transaction
: private_key - a private key to sign this transaction with
'''

if not parent_tx_outputs and not private_key:
return self.req("signrawtransaction", [rawtxhash])
else:
return self.req("signrawtransaction",
[rawtxhash, parent_tx_outputs, private_key])

def sendrawtransaction(self, signed_rawtxhash):
'''sends raw transaction, returns txid'''
Expand Down

0 comments on commit f84e440

Please sign in to comment.