From 4ba19eb67953e9190ec19ccd9f4b067f534c404b Mon Sep 17 00:00:00 2001 From: Daniel Edgecumbe Date: Sun, 1 Oct 2017 03:12:15 +0100 Subject: [PATCH] [transaction] Inform user in the event that a transaction is not loaded --- transaction.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/transaction.py b/transaction.py index 484367f..14e62bb 100644 --- a/transaction.py +++ b/transaction.py @@ -195,6 +195,13 @@ class TransactionView(view.View): self._pad.addstr(14+i-offset, 1, "{:05d} {} {: 15.8f} BTC".format(i, outstring, out["value"]), outputcolor) + async def _draw_no_transaction(self): + CRED = curses.color_pair(3) + CBOLD = curses.A_BOLD + self._pad.addstr(0, 1, "no transaction loaded", CRED + CBOLD) + self._pad.addstr(1, 1, "enter block view and select a transaction", CRED) + self._pad.addstr(2, 1, "note that most transactions will be unavailable if -txindex is not enabled on your node", CRED) + async def _draw(self): self._clear_init_pad() @@ -218,6 +225,8 @@ class TransactionView(view.View): await self._draw_inputs(transaction, inouts) if "vout" in transaction: await self._draw_outputs(transaction) + else: + await self._draw_no_transaction() self._draw_pad_to_screen()