aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build-osx.txt9
-rw-r--r--init.cpp4
-rw-r--r--main.cpp7
-rw-r--r--rpc.cpp14
-rw-r--r--ui.cpp2
-rw-r--r--util.cpp29
-rw-r--r--util.h9
7 files changed, 52 insertions, 22 deletions
diff --git a/build-osx.txt b/build-osx.txt
index a67a3be2e8..79279838d3 100644
--- a/build-osx.txt
+++ b/build-osx.txt
@@ -59,7 +59,10 @@ cd ~/bitcoin/deps
tar xvjf ~/Downloads/boost_1_42_0.tar.bz2
cd boost_1_42_0
./bootstrap.sh
-./bjam architecture=combined address-model=32_64 macosx-version=10.6 macosx-version-min=10.5 link=static runtime-link=static --toolset=darwin --prefix=/Users/macosuser/bitcoin/deps install
+./bjam architecture=combined address-model=32_64 macosx-version=10.5 macosx-version-min=10.5 link=static runtime-link=static --toolset=darwin --prefix=/Users/macosuser/bitcoin/deps install
+
+If you're using Snow Leopard, you will need to specify 10.6 as your Mac OS X
+version instead of 10.5.
This part takes a while.. use your judgement and fix it if something doesn't
build for some reason.
@@ -90,12 +93,12 @@ tar xvf ~/Downloads/openssl-1.0.0.tar
mv openssl-1.0.0 openssl-1.0.0-x86_64
# build i386 (32 bit intel) binary
cd openssl-1.0.0-i386
-./Configure --prefix=/Users/macosuser/bitcoin/deps --openssldir=/Users/macosuser/deps/openssl darwin-i386-cc && make
+./Configure --prefix=/Users/macosuser/bitcoin/deps --openssldir=/Users/macosuser/bitcoin/deps/openssl darwin-i386-cc && make
make install # only do this on one of the architectures, to install the headers
cd ..
# build x86_64 (64 bit intel) binary
cd openssl-1.0.0-x86_64
-./Configure --prefix=/Users/macosuser/bitcoin/deps --openssldir=/Users/macosuser/deps/openssl darwin64-x86_64-cc && make
+./Configure --prefix=/Users/macosuser/bitcoin/deps --openssldir=/Users/macosuser/bitcoin/deps/openssl darwin64-x86_64-cc && make
cd ..
# combine the libs
diff --git a/init.cpp b/init.cpp
index dcfc6765b5..68ed11f6b8 100644
--- a/init.cpp
+++ b/init.cpp
@@ -144,7 +144,7 @@ bool AppInit2(int argc, char* argv[])
{
string beta = VERSION_IS_BETA ? _(" beta") : "";
string strUsage = string() +
- _("Bitcoin version") + " " + FormatVersion(VERSION) + pszSubVer + beta + "\n\n" +
+ _("Bitcoin version") + " " + FormatFullVersion() + "\n\n" +
_("Usage:") + "\t\t\t\t\t\t\t\t\t\t\n" +
" bitcoin [options] \t " + "\n" +
" bitcoin [options] <command> [params]\t " + _("Send command to -server or bitcoind\n") +
@@ -267,7 +267,7 @@ bool AppInit2(int argc, char* argv[])
if (!fDebug && !pszSetDataDir[0])
ShrinkDebugFile();
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- printf("Bitcoin version %s%s%s\n", FormatVersion(VERSION).c_str(), pszSubVer, VERSION_IS_BETA ? _(" beta") : "");
+ printf("Bitcoin version %s\n", FormatFullVersion().c_str());
#ifdef GUI
printf("OS version %s\n", ((string)wxGetOsDescription()).c_str());
printf("System default language is %d %s\n", g_locale.GetSystemLanguage(), ((string)g_locale.GetSysName()).c_str());
diff --git a/main.cpp b/main.cpp
index c7ae47f69e..67db0bce88 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1182,7 +1182,7 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits)
bool IsInitialBlockDownload()
{
- if (pindexBest == NULL || (!fTestNet && nBestHeight < 105000))
+ if (pindexBest == NULL || (!fTestNet && nBestHeight < 118000))
return true;
static int64 nLastUpdate;
static CBlockIndex* pindexLastBest;
@@ -1748,7 +1748,8 @@ bool CBlock::AcceptBlock()
(nHeight == 68555 && hash != uint256("0x00000000001e1b4903550a0b96e9a9405c8a95f387162e4944e8d9fbe501cd6a")) ||
(nHeight == 70567 && hash != uint256("0x00000000006a49b14bcf27462068f1264c961f11fa2e0eddd2be0791e1d4124a")) ||
(nHeight == 74000 && hash != uint256("0x0000000000573993a3c9e41ce34471c079dcf5f52a0e824a81e7f953b8661a20")) ||
- (nHeight == 105000 && hash != uint256("0x00000000000291ce28027faea320c8d2b054b2e0fe44a773f3eefb151d6bdc97")))
+ (nHeight == 105000 && hash != uint256("0x00000000000291ce28027faea320c8d2b054b2e0fe44a773f3eefb151d6bdc97")) ||
+ (nHeight == 118000 && hash != uint256("0x000000000000774a7f8a7a12dc906ddb9e17e75d684f15e00f8767f9e8f36553")))
return error("AcceptBlock() : rejected by checkpoint lockin at %d", nHeight);
// Write block to history file
@@ -1765,7 +1766,7 @@ bool CBlock::AcceptBlock()
if (hashBestChain == hash)
CRITICAL_BLOCK(cs_vNodes)
foreach(CNode* pnode, vNodes)
- if (nBestHeight > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : 105000))
+ if (nBestHeight > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : 118000))
pnode->PushInventory(CInv(MSG_BLOCK, hash));
return true;
diff --git a/rpc.cpp b/rpc.cpp
index 93df5c22a4..0866bb50ed 100644
--- a/rpc.cpp
+++ b/rpc.cpp
@@ -1480,7 +1480,7 @@ string HTTPPost(const string& strMsg, const map<string,string>& mapRequestHeader
{
ostringstream s;
s << "POST / HTTP/1.1\r\n"
- << "User-Agent: json-rpc/1.0\r\n"
+ << "User-Agent: bitcoin-json-rpc/" << FormatFullVersion() << "\r\n"
<< "Host: 127.0.0.1\r\n"
<< "Content-Type: application/json\r\n"
<< "Content-Length: " << strMsg.size() << "\r\n"
@@ -1498,7 +1498,10 @@ string rfc1123Time()
time_t now;
time(&now);
struct tm* now_gmt = gmtime(&now);
- strftime(buffer, sizeof(buffer), "%a, %d %b %Y %H:%M:%S %Z", now_gmt);
+ string locale(setlocale(LC_TIME, NULL));
+ setlocale(LC_TIME, "C"); // we want posix (aka "C") weekday/month strings
+ strftime(buffer, sizeof(buffer), "%a, %d %b %Y %H:%M:%S +0000", now_gmt);
+ setlocale(LC_TIME, locale.c_str());
return string(buffer);
}
@@ -1507,7 +1510,7 @@ string HTTPReply(int nStatus, const string& strMsg)
if (nStatus == 401)
return strprintf("HTTP/1.0 401 Authorization Required\r\n"
"Date: %s\r\n"
- "Server: bitcoin-json-rpc\r\n"
+ "Server: bitcoin-json-rpc/%s\r\n"
"WWW-Authenticate: Basic realm=\"jsonrpc\"\r\n"
"Content-Type: text/html\r\n"
"Content-Length: 296\r\n"
@@ -1520,7 +1523,7 @@ string HTTPReply(int nStatus, const string& strMsg)
"<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=ISO-8859-1'>\r\n"
"</HEAD>\r\n"
"<BODY><H1>401 Unauthorized.</H1></BODY>\r\n"
- "</HTML>\r\n", rfc1123Time().c_str());
+ "</HTML>\r\n", rfc1123Time().c_str(), FormatFullVersion().c_str());
string strStatus;
if (nStatus == 200) strStatus = "OK";
else if (nStatus == 400) strStatus = "Bad Request";
@@ -1532,13 +1535,14 @@ string HTTPReply(int nStatus, const string& strMsg)
"Connection: close\r\n"
"Content-Length: %d\r\n"
"Content-Type: application/json\r\n"
- "Server: bitcoin-json-rpc/1.0\r\n"
+ "Server: bitcoin-json-rpc/%s\r\n"
"\r\n"
"%s",
nStatus,
strStatus.c_str(),
rfc1123Time().c_str(),
strMsg.size(),
+ FormatFullVersion().c_str(),
strMsg.c_str());
}
diff --git a/ui.cpp b/ui.cpp
index 45e07d16ea..5d4c6529ff 100644
--- a/ui.cpp
+++ b/ui.cpp
@@ -1814,7 +1814,7 @@ void COptionsDialog::OnButtonApply(wxCommandEvent& event)
CAboutDialog::CAboutDialog(wxWindow* parent) : CAboutDialogBase(parent)
{
- m_staticTextVersion->SetLabel(strprintf(_("version %s%s BETA"), FormatVersion(VERSION).c_str(), pszSubVer));
+ m_staticTextVersion->SetLabel(strprintf(_("version %s"), FormatFullVersion().c_str()));
// Change (c) into UTF-8 or ANSI copyright symbol
wxString str = m_staticTextMain->GetLabel();
diff --git a/util.cpp b/util.cpp
index 06da0cb1e4..2359616689 100644
--- a/util.cpp
+++ b/util.cpp
@@ -874,3 +874,32 @@ void AddTimeData(unsigned int ip, int64 nTime)
printf("| nTimeOffset = %+"PRI64d" (%+"PRI64d" minutes)\n", nTimeOffset, nTimeOffset/60);
}
}
+
+
+
+
+
+
+
+
+
+string FormatVersion(int nVersion)
+{
+ if (nVersion%100 == 0)
+ return strprintf("%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100);
+ else
+ return strprintf("%d.%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100, nVersion%100);
+}
+
+string FormatFullVersion()
+{
+ string s = FormatVersion(VERSION) + pszSubVer;
+ if (VERSION_IS_BETA)
+ s += _("-beta");
+ return s;
+}
+
+
+
+
+
diff --git a/util.h b/util.h
index 4bd5cb8954..44afffcbf6 100644
--- a/util.h
+++ b/util.h
@@ -186,6 +186,7 @@ uint64 GetRand(uint64 nMax);
int64 GetTime();
int64 GetAdjustedTime();
void AddTimeData(unsigned int ip, int64 nTime);
+string FormatFullVersion();
@@ -433,14 +434,6 @@ inline bool GetBoolArg(const string& strArg)
return false;
}
-inline string FormatVersion(int nVersion)
-{
- if (nVersion%100 == 0)
- return strprintf("%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100);
- else
- return strprintf("%d.%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100, nVersion%100);
-}
-