aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/db.cpp16
-rw-r--r--src/qt/optionsmodel.cpp4
2 files changed, 17 insertions, 3 deletions
diff --git a/src/db.cpp b/src/db.cpp
index ea6d46a6e5..4d4a3c4696 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -931,7 +931,21 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
if (strKey == "fMinimizeToTray") ssValue >> fMinimizeToTray;
if (strKey == "fMinimizeOnClose") ssValue >> fMinimizeOnClose;
if (strKey == "fUseProxy") ssValue >> fUseProxy;
- if (strKey == "addrProxy") ssValue >> addrProxy;
+ if (strKey == "addrProxy")
+ {
+ CAddress addr;
+ CDataStream ssValue2 = ssValue;
+ // 0.6.0rc1 saved this as a CService, which causes failure when parsing as a CAddress
+ try
+ {
+ ssValue >> addr;
+ addrProxy = addr;
+ }
+ catch (std::ios_base::failure &e)
+ {
+ ssValue2 >> addrProxy;
+ }
+ }
if (fHaveUPnP && strKey == "fUseUPnP") ssValue >> fUseUPnP;
}
else if (strType == "minversion")
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index edc1d61e9d..dd69093897 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -91,7 +91,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
if (addr.IsValid())
{
addrProxy.SetIP(addr);
- walletdb.WriteSetting("addrProxy", addrProxy);
+ walletdb.WriteSetting("addrProxy", CAddress(addrProxy));
}
else
{
@@ -105,7 +105,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
if (nPort > 0 && nPort < std::numeric_limits<unsigned short>::max())
{
addrProxy.SetPort(nPort);
- walletdb.WriteSetting("addrProxy", addrProxy);
+ walletdb.WriteSetting("addrProxy", CAddress(addrProxy));
}
else
{