Skip to content

Commit

Permalink
Merge pull request #2 from OleksandrBlack/master
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
FairExchange committed Aug 27, 2019
2 parents 26d59b3 + cb81b92 commit 9e84529
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 19 deletions.
24 changes: 12 additions & 12 deletions src/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@
<item row="7" column="2">
<widget class="QLabel" name="last_reg_height">
<property name="text">
<string>not address index</string>
<string>not configured</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -1380,7 +1380,7 @@
<item row="2" column="2">
<widget class="QLabel" name="balance">
<property name="text">
<string>not address index</string>
<string>not configured</string>
</property>
</widget>
</item>
Expand All @@ -1394,21 +1394,21 @@
<item row="4" column="2">
<widget class="QLabel" name="collateral">
<property name="text">
<string>not address index</string>
<string>not configured</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="balance_usd">
<property name="text">
<string>not address index</string>
<string>not configured</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QLabel" name="tier">
<property name="text">
<string>not address index</string>
<string>not configured</string>
</property>
</widget>
</item>
Expand All @@ -1432,7 +1432,7 @@
<item row="5" column="2">
<widget class="QLabel" name="collateral_usd">
<property name="text">
<string>not address index</string>
<string>not configured</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -1473,7 +1473,7 @@
<item row="8" column="2">
<widget class="QLabel" name="valid_thru_height">
<property name="text">
<string>not address index</string>
<string>not configured</string>
</property>
</widget>
</item>
Expand All @@ -1485,18 +1485,18 @@
</widget>
</item>
<item row="23" column="1">
<widget class="QGroupBox" name="groupBox_9">
<widget class="QGroupBox" name="groupBox_10">
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="title">
<string/>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_12">
<layout class="QVBoxLayout" name="verticalLayout_13">
<item>
<layout class="QGridLayout" name="gridLayout_Info">
<layout class="QGridLayout" name="gridLayout_Info2">
<item row="4" column="1">
<widget class="QLabel" name="safeheightsep">
<property name="text">
Expand Down Expand Up @@ -1632,7 +1632,7 @@
<property name="title">
<string/>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<layout class="QGridLayout" name="gridLayout_8">
<item row="1" column="0">
<layout class="QFormLayout" name="formLayout">
<item row="1" column="1">
Expand Down
29 changes: 22 additions & 7 deletions src/rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,8 @@ void RPC::getInfoThenRefresh(bool force) {

double balance, collateral;
int tier;
int last_reg_height;
int valid_thru_height;

try
{
Expand All @@ -699,7 +701,7 @@ void RPC::getInfoThenRefresh(bool force) {
}
catch (...)
{
ui->collateral->setText("unknown");
ui->collateral->setText("unknown");
ui->collateral_usd->setText("unknown");
}

Expand All @@ -713,12 +715,25 @@ void RPC::getInfoThenRefresh(bool force) {
ui->tier->setText("unknown");
}

int last_reg_height = reply["last_reg_height"].get<json::number_integer_t>();
int valid_thru_height = reply["valid_thru_height"].get<json::number_integer_t>();

ui->last_reg_height->setText(QString::number(last_reg_height));
ui->valid_thru_height->setText(QString::number(valid_thru_height));

try
{
last_reg_height = reply["last_reg_height"].get<json::number_integer_t>();
ui->last_reg_height->setText(QString::number(last_reg_height));
}
catch (...)
{
ui->last_reg_height->setText("unknown");
}

try
{
valid_thru_height = reply["valid_thru_height"].get<json::number_integer_t>();
ui->valid_thru_height->setText(QString::number(valid_thru_height));
}
catch (...)
{
ui->last_reg_height->setText("unknown");
}
}

bool is_valid;
Expand Down

0 comments on commit 9e84529

Please sign in to comment.