void ThreadRPCServer3(void* parg);
-static inline unsigned short GetDefaultRPCPort()
+static inline uint16_t GetDefaultRPCPort()
{
return GetBoolArg("-testnet", false) ? 18344 : 8344;
}
return (double)amount / (double)COIN;
}
-std::string HexBits(unsigned int nBits)
+string HexBits(uint32_t nBits)
{
union {
- int32_t nBits;
+ uint32_t nBits;
char cBits[4];
} uBits;
- uBits.nBits = htonl((int32_t)nBits);
+ uBits.nBits = htonl(nBits);
return HexStr(BEGIN(uBits.cBits), END(uBits.cBits));
}
-
//
// Utilities: convert hex-encoded Values
// (throws error if not hex).
{
auto strHeader = str.substr(0, nColon);
boost::trim(strHeader);
- boost::to_lower(strHeader);
+ transform(strHeader.begin(), strHeader.end(), strHeader.begin(), ::tolower);
auto strValue = str.substr(nColon+1);
boost::trim(strValue);
mapHeadersRet[strHeader] = strValue;
asio::ssl::stream<asio::ip::tcp::socket> sslStream(io_service, context);
SSLIOStreamDevice<asio::ip::tcp> d(sslStream, fUseSSL);
iostreams::stream< SSLIOStreamDevice<asio::ip::tcp> > stream(d);
- if (!d.connect(GetArg("-rpcconnect", "127.0.0.1"), GetArg("-rpcport", itostr(GetDefaultRPCPort()))))
+ if (!d.connect(GetArg("-rpcconnect", "127.0.0.1"), GetArg("-rpcport", to_string(GetDefaultRPCPort()))))
throw runtime_error("couldn't connect to server");
// HTTP basic authentication