diff --git a/lib/commands.py b/lib/commands.py
index ccaa038a9..ef04fe056 100644
--- a/lib/commands.py
+++ b/lib/commands.py
@@ -72,7 +72,7 @@ register_command('getaddressbalance', 1, 1, True, True, False, 'Return the
register_command('getaddresshistory', 1, 1, True, True, False, 'Return the transaction history of a wallet address', 'getaddresshistory
')
register_command('getconfig', 1, 1, False, False, False, 'Return a configuration variable', 'getconfig ')
register_command('getpubkeys', 1, 1, False, True, False, 'Return the public keys for a wallet address', 'getpubkeys ')
-register_command('getrawtransaction', 1, 2, True, False, False, 'Retrieve a transaction', 'getrawtransaction ')
+register_command('getrawtransaction', 1, 1, True, False, False, 'Retrieve a transaction', 'getrawtransaction ')
register_command('getseed', 0, 0, False, True, True, 'Print the generation seed of your wallet.')
register_command('getmpk', 0, 0, False, True, False, 'Return your wallet\'s master public key', 'getmpk')
register_command('help', 0, 1, False, False, False, 'Prints this help')
@@ -350,11 +350,11 @@ class Commands:
if cmd.options: print_msg("options:\n" + cmd.options)
return None
- def getrawtransaction(self, tx_hash, height = 0):
- tx = self.wallet.transactions.get(tx_hash)
- if tx:
- return tx
- height = int(height)
- return self.network.retrieve_transaction(tx_hash, height)
+ def getrawtransaction(self, tx_hash):
+ if self.wallet:
+ tx = self.wallet.transactions.get(tx_hash)
+ if tx:
+ return tx
+ return self.network.retrieve_transaction(tx_hash)