Browse Source

remove some unused functions

Identified with `cppcheck --enable=unusedFunction .`.

 - GetSendBufferSize()'s last use removed in
   991955ee81
 - SetPort()'s last use removed in
   7e195e8459
 - GetfLargeWorkInvalidChainFound() was introduced in
   e3ba0ef956 and never used
0.15
Marko Bencun 8 years ago
parent
commit
f228b8e163
  1. 1
      src/net.cpp
  2. 2
      src/net.h
  3. 5
      src/netaddress.cpp
  4. 1
      src/netaddress.h
  5. 6
      src/warnings.cpp
  6. 1
      src/warnings.h

1
src/net.cpp

@ -2691,7 +2691,6 @@ int CConnman::GetBestHeight() const
} }
unsigned int CConnman::GetReceiveFloodSize() const { return nReceiveFloodSize; } unsigned int CConnman::GetReceiveFloodSize() const { return nReceiveFloodSize; }
unsigned int CConnman::GetSendBufferSize() const{ return nSendBufferMaxSize; }
CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn, SOCKET hSocketIn, const CAddress& addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, const CAddress &addrBindIn, const std::string& addrNameIn, bool fInboundIn) : CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn, SOCKET hSocketIn, const CAddress& addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, const CAddress &addrBindIn, const std::string& addrNameIn, bool fInboundIn) :
nTimeConnected(GetSystemTimeInSeconds()), nTimeConnected(GetSystemTimeInSeconds()),

2
src/net.h

@ -242,8 +242,6 @@ public:
bool DisconnectNode(const std::string& node); bool DisconnectNode(const std::string& node);
bool DisconnectNode(NodeId id); bool DisconnectNode(NodeId id);
unsigned int GetSendBufferSize() const;
ServiceFlags GetLocalServices() const; ServiceFlags GetLocalServices() const;
//!set the max outbound target in bytes //!set the max outbound target in bytes

5
src/netaddress.cpp

@ -598,11 +598,6 @@ std::string CService::ToString() const
return ToStringIPPort(); return ToStringIPPort();
} }
void CService::SetPort(unsigned short portIn)
{
port = portIn;
}
CSubNet::CSubNet(): CSubNet::CSubNet():
valid(false) valid(false)
{ {

1
src/netaddress.h

@ -148,7 +148,6 @@ class CService : public CNetAddr
CService(const struct in_addr& ipv4Addr, unsigned short port); CService(const struct in_addr& ipv4Addr, unsigned short port);
CService(const struct sockaddr_in& addr); CService(const struct sockaddr_in& addr);
void Init(); void Init();
void SetPort(unsigned short portIn);
unsigned short GetPort() const; unsigned short GetPort() const;
bool GetSockAddr(struct sockaddr* paddr, socklen_t *addrlen) const; bool GetSockAddr(struct sockaddr* paddr, socklen_t *addrlen) const;
bool SetSockAddr(const struct sockaddr* paddr); bool SetSockAddr(const struct sockaddr* paddr);

6
src/warnings.cpp

@ -37,12 +37,6 @@ void SetfLargeWorkInvalidChainFound(bool flag)
fLargeWorkInvalidChainFound = flag; fLargeWorkInvalidChainFound = flag;
} }
bool GetfLargeWorkInvalidChainFound()
{
LOCK(cs_warnings);
return fLargeWorkInvalidChainFound;
}
std::string GetWarnings(const std::string& strFor) std::string GetWarnings(const std::string& strFor)
{ {
std::string strStatusBar; std::string strStatusBar;

1
src/warnings.h

@ -13,7 +13,6 @@ void SetMiscWarning(const std::string& strWarning);
void SetfLargeWorkForkFound(bool flag); void SetfLargeWorkForkFound(bool flag);
bool GetfLargeWorkForkFound(); bool GetfLargeWorkForkFound();
void SetfLargeWorkInvalidChainFound(bool flag); void SetfLargeWorkInvalidChainFound(bool flag);
bool GetfLargeWorkInvalidChainFound();
/** Format a string that describes several potential problems detected by the core. /** Format a string that describes several potential problems detected by the core.
* strFor can have three values: * strFor can have three values:
* - "rpc": get critical warnings, which should put the client in safe mode if non-empty * - "rpc": get critical warnings, which should put the client in safe mode if non-empty

Loading…
Cancel
Save