'Retrieve a transaction.'

@command('n')
def gettransaction(self, txid):

    if (self.wallet and (txid in self.wallet.transactions)):
        tx = self.wallet.transactions[txid]
    else:
        raw = self.network.synchronous_get(('blockchain.transaction.get', [txid]))
        if raw:
            tx = Transaction(raw)
        else:
            raise BaseException('Unknown    transaction')
    return tx.as_dict()
