From 67a42f929b1434f647c63922fd02dc2b93b28060 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 3 Jan 2012 23:33:31 +0100 Subject: Network stack refactor This introduces CNetAddr and CService, respectively wrapping an (IPv6) IP address and an IP+port combination. This functionality used to be part of CAddress, which also contains network flags and connection attempt information. These extra fields are however not always necessary. These classes, along with logic for creating connections and doing name lookups, are moved to netbase.{h,cpp}, which does not depend on headers.h. Furthermore, CNetAddr is mostly IPv6-ready, though IPv6 functionality is not yet enabled for the application itself. --- src/qt/optionsmodel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/qt/optionsmodel.cpp') diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index a68c84c957..3237845c2c 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -88,9 +88,9 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in { // Use CAddress to parse and check IP CAddress addr(value.toString().toStdString() + ":1"); - if (addr.ip != INADDR_NONE) + if (addr.IsValid()) { - addrProxy.ip = addr.ip; + addrProxy.SetIP(addr); walletdb.WriteSetting("addrProxy", addrProxy); } else @@ -104,7 +104,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in int nPort = atoi(value.toString().toAscii().data()); if (nPort > 0 && nPort < std::numeric_limits::max()) { - addrProxy.port = htons(nPort); + addrProxy.SetPort(nPort); walletdb.WriteSetting("addrProxy", addrProxy); } else -- cgit v1.2.3