Fix crash on receive tab

This commit is contained in:
Aditya Kulkarni
2019-03-20 10:40:09 -07:00
parent f23cf1d0e0
commit 09e25c9b5e

View File

@@ -1275,8 +1275,10 @@ std::function<void(bool)> MainWindow::addZAddrsToComboList(bool sapling) {
std::for_each(addrs->begin(), addrs->end(), [=] (auto addr) {
if ( (sapling && Settings::getInstance()->isSaplingAddress(addr)) ||
(!sapling && !Settings::getInstance()->isSaplingAddress(addr))) {
auto bal = rpc->getAllBalances()->value(addr);
ui->listRecieveAddresses->addItem(addr, bal);
if (rpc->getAllBalances()) {
auto bal = rpc->getAllBalances()->value(addr);
ui->listRecieveAddresses->addItem(addr, bal);
}
}
});
@@ -1322,8 +1324,13 @@ void MainWindow::setupRecieveTab() {
else {
ui->btnRecieveNewAddr->setToolTip("");
}
addZAddrsToComboList(false)(checked);
bool showWarning = checked && Settings::getInstance()->getZcashdVersion() < 2000450;
ui->lblSproutWarning->setVisible(showWarning);
});
QObject::connect(ui->rdioZSAddr, &QRadioButton::toggled, addZAddrsToComboList(true));
// Explicitly get new address button.