mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Fix addrProxy setting
Before 0.6 addrProxy was a CAddress, but netbase changed it to CService. Retain compatibility by wrapping/unwrapping with a CAddress when saving or loading. This commit retains compatibility with 0.6.0rc1 (which wrote the setting as a CService) by trying to parse twice.
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user