diff --git a/src/base/net/stratum/DaemonClient.cpp b/src/base/net/stratum/DaemonClient.cpp index 821045e9..f383308c 100644 --- a/src/base/net/stratum/DaemonClient.cpp +++ b/src/base/net/stratum/DaemonClient.cpp @@ -66,7 +66,6 @@ Storage DaemonClient::m_storage; static const char* kBlocktemplateBlob = "blocktemplate_blob"; static const char* kBlockhashingBlob = "blockhashing_blob"; -static const char* kLastError = "lasterror"; static const char *kGetHeight = "/getheight"; static const char *kGetInfo = "/getinfo"; static const char *kHash = "hash"; diff --git a/src/crypto/randomx/bytecode_machine.hpp b/src/crypto/randomx/bytecode_machine.hpp index 8852f4d6..247e76e9 100644 --- a/src/crypto/randomx/bytecode_machine.hpp +++ b/src/crypto/randomx/bytecode_machine.hpp @@ -240,10 +240,17 @@ namespace randomx { return x; } + void cleanup() { + for (unsigned i = 0; i < RegistersCount; ++i) { + registerUsage[i] = -1; + } + nreg = nullptr; + } + private: static const int_reg_t zero; - int registerUsage[RegistersCount]; - NativeRegisterFile* nreg; + int registerUsage[RegistersCount] = {}; + NativeRegisterFile* nreg = nullptr; static void* getScratchpadAddress(InstructionByteCode& ibc, uint8_t* scratchpad) { uint32_t addr = (*ibc.isrc + ibc.imm) & ibc.memMask; diff --git a/src/crypto/randomx/vm_interpreted.cpp b/src/crypto/randomx/vm_interpreted.cpp index 840ea768..9973a228 100644 --- a/src/crypto/randomx/vm_interpreted.cpp +++ b/src/crypto/randomx/vm_interpreted.cpp @@ -104,6 +104,8 @@ namespace randomx { for (unsigned i = 0; i < RegisterCountFlt; ++i) rx_store_vec_f128(®.e[i].lo, nreg.e[i]); + + cleanup(); } template