Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions test/daemon/kawpow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int main(int argc, const char* argv[])
{
static int epoch_number = 0;
std::uint16_t SrvPort = DEFAULT_PORT;
static ethash::epoch_context_ptr context_light{nullptr, nullptr};
static ethash::epoch_context_full_ptr context_full{nullptr, nullptr};

for (int i = 0; i < argc; ++i)
{
Expand All @@ -41,9 +41,10 @@ int main(int argc, const char* argv[])
}

// Build context
if (!context_light || context_light->epoch_number != epoch_number) {
if (!context_full || context_full->epoch_number != epoch_number) {
std::cout << "Building context for epoch: " << epoch_number << std::endl;
context_light = ethash::create_epoch_context(epoch_number);
context_full = ethash::create_epoch_context_full(epoch_number);

}

if (!event_init())
Expand Down Expand Up @@ -126,12 +127,12 @@ int main(int argc, const char* argv[])

// Check epoch number and context
epoch_number = (int) nHeight / ETHASH_EPOCH_LENGTH;
if (!context_light || context_light->epoch_number != epoch_number) {
context_light = ethash::create_epoch_context(epoch_number);
if (!context_full || context_full->epoch_number != epoch_number) {
std::cout << "Building new context for epoch: " << epoch_number << std::endl;
context_full = ethash::create_epoch_context_full(epoch_number);
}

const auto result = progpow::hash(*context_light, (int) nHeight, header_hash, nNonce);
const auto result = progpow::hash(*context_full, (int) nHeight, header_hash, nNonce);
std::string share_met = "false";
std::string block_met = "false";
std::string mix_match = "false";
Expand Down
2 changes: 1 addition & 1 deletion test/unittests/progpow_test_vectors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ progpow_hash_test_case progpow_hash_test_cases[] = {
"4cf1fa62f25b577ac822a6a28d55f8b7e3ae7fe983abd868ae00927e68c41016"},
{170915, "5b3e8dfa1aafd3924a51f33e2d672d8dae32fa528d8b1d378d6e4db0ec5d665d", "0000000044975727",
"efb29147484c434f1cc59629da90fd0343e3b047407ecd36e9ad973bd51bbac5",
"e7e6bb3b2f9acd3864bc86f72f87237eaf475633ef650c726ac80eb0adf116b6"},
"e7e6bb3b2f9acd3864bc86f72f87237eaf475633ef650c726ac80eb0adf116b6"}

};
} // namespace