# Buggy code
def get_transactions(self):
    options = {
        "nolnet": False,
        "password": None,
        "verbose": False,
        "cmd": "history",
        "wallet_path": self.wallet_file,
        "testnet": self.TESTNET,
        "segwit": False,
        "cwd": self.wallet_dir,
        "portable": False,
    }
    config = SimpleConfig(options)

    server = self.get_daemon().get_server(config)
    try:
        result = server.run_cmdline(options)
    except ProtocolError:
        self._logger.error("Unable to fetch transactions from BTC wallet!")
        return succeed([])

    transactions = []
    for transaction in result:
        outgoing = transaction["value"] < 0
        from_address = ",".join(transaction["input_addresses"])
        to_address = ",".join(transaction["output_addresses"])

        transactions.append(
            {
                "id": transaction["txid"],
                "outgoing": outgoing,
                "from": from_address,
                "to": to_address,
                "amount": abs(transaction["value"]),
                "fee_amount": 0.0,
                "currency": "BTC",
                "timestamp": str(transaction["timestamp"]),
                "description": "Confirmations: %d" % transaction["confirmations"],
            }
        )

    return succeed(transactions)


# Traceback (EOFError)
Gkr-Message: secret service operation failed: The name org.freedesktop.secrets was not provided by any .service files
Exception in thread tribler-pipe-read:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/bram/git/tribler/TriblerGUI/core_manager.py", line 173, in <lambda>
pipe_thread = Thread(target=lambda: self.pipe_wait(parent_conn), name="tribler-pipe-read")
File "/home/bram/git/tribler/TriblerGUI/core_manager.py", line 158, in pipe_wait
cmd, arg = child_conn.recv()
EOFError

# Fixed code
def get_transactions(self):
    if not self.created or not self.unlocked:
        return succeed([])

    options = {
        "nolnet": False,
        "password": None,
        "verbose": False,
        "cmd": "history",
        "wallet_path": self.wallet_file,
        "testnet": self.TESTNET,
        "segwit": False,
        "cwd": self.wallet_dir,
        "portable": False,
    }
    config = SimpleConfig(options)

    server = self.get_daemon().get_server(config)
    try:
        result = server.run_cmdline(options)
    except ProtocolError:
        self._logger.error("Unable to fetch transactions from BTC wallet!")
        return succeed([])

    transactions = []
    for transaction in result:
        outgoing = transaction["value"] < 0
        from_address = ",".join(transaction["input_addresses"])
        to_address = ",".join(transaction["output_addresses"])

        transactions.append(
            {
                "id": transaction["txid"],
                "outgoing": outgoing,
                "from": from_address,
                "to": to_address,
                "amount": abs(transaction["value"]),
                "fee_amount": 0.0,
                "currency": "BTC",
                "timestamp": str(transaction["timestamp"]),
                "description": "Confirmations: %d" % transaction["confirmations"],
            }
        )

    return succeed(transactions)