aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/checkpoints.cpp5
-rw-r--r--src/leveldb/port/port_posix.h6
-rw-r--r--src/makefile.mingw4
-rw-r--r--src/test/hash_tests.cpp44
4 files changed, 54 insertions, 5 deletions
diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp
index 0716cfca31..bb551501f1 100644
--- a/src/checkpoints.cpp
+++ b/src/checkpoints.cpp
@@ -47,11 +47,12 @@ namespace Checkpoints
(210000, uint256("0x000000000000048b95347e83192f69cf0366076336c639f9b7228e9ba171342e"))
(216116, uint256("0x00000000000001b4f4b433e81ee46494af945cf96014816a4e2370f11b23df4e"))
(225430, uint256("0x00000000000001c108384350f74090433e7fcf79a606b8e797f065b130575932"))
+ (250000, uint256("0x000000000000003887df1f29024b06fc2200b55f8af8f35453d7be294df2d214"))
;
static const CCheckpointData data = {
&mapCheckpoints,
- 1363044259, // * UNIX timestamp of last checkpoint block
- 14264869, // * total number of transactions between genesis and last checkpoint
+ 1375533383, // * UNIX timestamp of last checkpoint block
+ 21491097, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the SetBestChain debug.log lines)
60000.0 // * estimated number of transactions per day after checkpoint
};
diff --git a/src/leveldb/port/port_posix.h b/src/leveldb/port/port_posix.h
index f2b89bffb9..21c845e211 100644
--- a/src/leveldb/port/port_posix.h
+++ b/src/leveldb/port/port_posix.h
@@ -62,12 +62,16 @@
#define fflush_unlocked fflush
#endif
-#if defined(OS_MACOSX) || defined(OS_FREEBSD) ||\
+#if defined(OS_FREEBSD) ||\
defined(OS_OPENBSD) || defined(OS_DRAGONFLYBSD)
// Use fsync() on platforms without fdatasync()
#define fdatasync fsync
#endif
+#if defined(OS_MACOSX)
+#define fdatasync(fd) fcntl(fd, F_FULLFSYNC, 0)
+#endif
+
#if defined(OS_ANDROID) && __ANDROID_API__ < 9
// fdatasync() was only introduced in API level 9 on Android. Use fsync()
// when targetting older platforms.
diff --git a/src/makefile.mingw b/src/makefile.mingw
index 464f69b1c9..cb989d8ae8 100644
--- a/src/makefile.mingw
+++ b/src/makefile.mingw
@@ -43,7 +43,7 @@ LIBS= \
-l ssl \
-l crypto
-DEFS=-DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE
+DEFS=-D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE
DEBUGFLAGS=-g
CFLAGS=-mthreads -O2 -w -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
# enable: ASLR, DEP and large address aware
@@ -63,7 +63,7 @@ ifneq (${USE_IPV6}, -)
DEFS += -DUSE_IPV6=$(USE_IPV6)
endif
-LIBS += -l kernel32 -l user32 -l gdi32 -l comdlg32 -l winspool -l winmm -l shell32 -l comctl32 -l ole32 -l oleaut32 -l uuid -l rpcrt4 -l advapi32 -l ws2_32 -l mswsock -l shlwapi
+LIBS += -l mingwthrd -l kernel32 -l user32 -l gdi32 -l comdlg32 -l winspool -l winmm -l shell32 -l comctl32 -l ole32 -l oleaut32 -l uuid -l rpcrt4 -l advapi32 -l ws2_32 -l mswsock -l shlwapi
# TODO: make the mingw builds smarter about dependencies, like the linux/osx builds are
HEADERS = $(wildcard *.h)
diff --git a/src/test/hash_tests.cpp b/src/test/hash_tests.cpp
new file mode 100644
index 0000000000..d69cfd706d
--- /dev/null
+++ b/src/test/hash_tests.cpp
@@ -0,0 +1,44 @@
+#include <boost/test/unit_test.hpp>
+#include <vector>
+
+#include "util.h"
+#include "hash.h"
+
+using namespace std;
+
+BOOST_AUTO_TEST_SUITE(hash_tests)
+
+BOOST_AUTO_TEST_CASE(murmurhash3)
+{
+
+#define T(expected, seed, data) BOOST_CHECK_EQUAL(MurmurHash3(seed, ParseHex(data)), expected)
+
+ // Test MurmurHash3 with various inputs. Of course this is retested in the
+ // bloom filter tests - they would fail if MurmurHash3() had any problems -
+ // but is useful for those trying to implement Bitcoin libraries as a
+ // source of test data for their MurmurHash3() primitive during
+ // development.
+ //
+ // The magic number 0xFBA4C795 comes from CBloomFilter::Hash()
+
+ T(0x00000000, 0x00000000, "");
+ T(0x6a396f08, 0xFBA4C795, "");
+ T(0x81f16f39, 0xffffffff, "");
+
+ T(0x514e28b7, 0x00000000, "00");
+ T(0xea3f0b17, 0xFBA4C795, "00");
+ T(0xfd6cf10d, 0x00000000, "ff");
+
+ T(0x16c6b7ab, 0x00000000, "0011");
+ T(0x8eb51c3d, 0x00000000, "001122");
+ T(0xb4471bf8, 0x00000000, "00112233");
+ T(0xe2301fa8, 0x00000000, "0011223344");
+ T(0xfc2e4a15, 0x00000000, "001122334455");
+ T(0xb074502c, 0x00000000, "00112233445566");
+ T(0x8034d2a0, 0x00000000, "0011223344556677");
+ T(0xb4698def, 0x00000000, "001122334455667788");
+
+#undef T
+}
+
+BOOST_AUTO_TEST_SUITE_END()