gettransaction command: require network instead of wallet
This commit is contained in:
parent
ac88ae9c7f
commit
608568839e
|
@ -506,11 +506,12 @@ class Commands:
|
||||||
out.append(item)
|
out.append(item)
|
||||||
return out
|
return out
|
||||||
|
|
||||||
@command('w')
|
@command('n')
|
||||||
def gettransaction(self, txid):
|
def gettransaction(self, txid):
|
||||||
"""Retrieve a transaction. """
|
"""Retrieve a transaction. """
|
||||||
tx = self.wallet.transactions.get(txid) if self.wallet else None
|
if self.wallet and txid in self.wallet.transactions:
|
||||||
if tx is None and self.network:
|
tx = self.wallet.transactions[txid]
|
||||||
|
else:
|
||||||
raw = self.network.synchronous_get(('blockchain.transaction.get', [txid]))
|
raw = self.network.synchronous_get(('blockchain.transaction.get', [txid]))
|
||||||
if raw:
|
if raw:
|
||||||
tx = Transaction(raw)
|
tx = Transaction(raw)
|
||||||
|
|
Loading…
Reference in New Issue