diff --git a/alethzero/Main.ui b/alethzero/Main.ui
index da5ee6c4a..34f240fbf 100644
--- a/alethzero/Main.ui
+++ b/alethzero/Main.ui
@@ -208,7 +208,7 @@
-
+
QDockWidget::DockWidgetFeatureMask
@@ -566,7 +566,7 @@
-
+
QDockWidget::DockWidgetFeatureMask
diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp
index d566882f3..f63cd74f0 100644
--- a/alethzero/MainWin.cpp
+++ b/alethzero/MainWin.cpp
@@ -135,6 +135,11 @@ Main::Main(QWidget *parent) :
// ui->log->addItem(QString::fromStdString(s));
};
+#if !ETH_FATDB
+ ui->dockWidgetAccounts->hide();
+ ui->dockWidgetContracts->hide();
+#endif
+
#if ETH_DEBUG
m_servers.append("localhost:30300");
#endif
@@ -1036,6 +1041,7 @@ void Main::refreshPending()
void Main::refreshAccounts()
{
+#if ETH_FATDB
cwatch << "refreshAccounts()";
ui->accounts->clear();
ui->contracts->clear();
@@ -1053,6 +1059,7 @@ void Main::refreshAccounts()
->setData(Qt::UserRole, QByteArray((char const*)i.data(), Address::size));
}
}
+#endif
}
void Main::refreshBlockCount()
@@ -1626,16 +1633,22 @@ void Main::on_ourAccounts_doubleClicked()
void Main::on_accounts_doubleClicked()
{
- auto hba = ui->accounts->currentItem()->data(Qt::UserRole).toByteArray();
- auto h = Address((byte const*)hba.data(), Address::ConstructFromPointer);
- qApp->clipboard()->setText(QString::fromStdString(toHex(h.asArray())));
+ if (!ui->accounts->isEmpty())
+ {
+ auto hba = ui->accounts->currentItem()->data(Qt::UserRole).toByteArray();
+ auto h = Address((byte const*)hba.data(), Address::ConstructFromPointer);
+ qApp->clipboard()->setText(QString::fromStdString(toHex(h.asArray())));
+ }
}
void Main::on_contracts_doubleClicked()
{
- auto hba = ui->contracts->currentItem()->data(Qt::UserRole).toByteArray();
- auto h = Address((byte const*)hba.data(), Address::ConstructFromPointer);
- qApp->clipboard()->setText(QString::fromStdString(toHex(h.asArray())));
+ if (!ui->contracts->isEmpty())
+ {
+ auto hba = ui->contracts->currentItem()->data(Qt::UserRole).toByteArray();
+ auto h = Address((byte const*)hba.data(), Address::ConstructFromPointer);
+ qApp->clipboard()->setText(QString::fromStdString(toHex(h.asArray())));
+ }
}
static shh::FullTopic topicFromText(QString _s)
diff --git a/libethereum/Interface.h b/libethereum/Interface.h
index 68eb4b094..b78106ae1 100644
--- a/libethereum/Interface.h
+++ b/libethereum/Interface.h
@@ -138,6 +138,7 @@ public:
virtual StateDiff diff(unsigned _txi, BlockNumber _block) const = 0;
/// Get a list of all active addresses.
+ /// NOTE: This only works when compiled with ETH_FATDB; otherwise will throw InterfaceNotSupported.
virtual Addresses addresses() const { return addresses(m_default); }
virtual Addresses addresses(BlockNumber _block) const = 0;
diff --git a/libethereum/State.cpp b/libethereum/State.cpp
index c5732116d..486abde12 100644
--- a/libethereum/State.cpp
+++ b/libethereum/State.cpp
@@ -342,6 +342,7 @@ u256 State::enactOn(bytesConstRef _block, BlockInfo const& _bi, BlockChain const
map State::addresses() const
{
+#if ETH_FATDB
map ret;
for (auto i: m_cache)
if (i.second.isAlive())
@@ -350,6 +351,9 @@ map State::addresses() const
if (m_cache.find(i.first) == m_cache.end())
ret[i.first] = RLP(i.second)[1].toInt();
return ret;
+#else
+ throw InterfaceNotSupported("State::addresses()");
+#endif
}
void State::resetCurrent()
diff --git a/libethereum/State.h b/libethereum/State.h
index 46a111a9b..3883a4897 100644
--- a/libethereum/State.h
+++ b/libethereum/State.h
@@ -127,6 +127,7 @@ public:
OverlayDB const& db() const { return m_db; }
/// @returns the set containing all addresses currently in use in Ethereum.
+ /// @throws InterfaceNotSupported if compiled without ETH_FATDB.
std::map addresses() const;
/// Get the header information on the present block.