diff --git a/Makefile b/Makefile index 329341e..3637eac 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,10 @@ else CXXFLAGS += -O2 endif +ifneq ($(STATIC_NONCE),) +CXXFLAGS += -DSTATIC_NONCE=1 +endif + SRCDIR := src INCDIR := inc BUILDDIR := obj diff --git a/src/libgourou.cpp b/src/libgourou.cpp index 148e8af..cdae6a7 100644 --- a/src/libgourou.cpp +++ b/src/libgourou.cpp @@ -282,7 +282,11 @@ namespace gourou struct timeval tv; gettimeofday(&tv, 0); uint32_t nonce32[2] = {0x6f046000, 0x388a}; +#ifdef STATIC_NONCE + uint64_t bigtime = 0xAA001122BBCCAAULL; +#else uint64_t bigtime = tv.tv_sec*1000; +#endif nonce32[0] += (bigtime & 0xFFFFFFFF) + (tv.tv_usec/1000); nonce32[1] += ((bigtime >> 32) & 0xFFFFFFFF);