From 9fceedf64ce9b0e1981e19222c78bc8cbb7a9042 Mon Sep 17 00:00:00 2001 From: Sergey Kroshnin Date: Mon, 6 Apr 2020 17:19:09 +0300 Subject: [PATCH] Use count to find out if difficulty is defined --- nano/node/json_handler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nano/node/json_handler.cpp b/nano/node/json_handler.cpp index 8a72ddf5ff..fd376c048e 100644 --- a/nano/node/json_handler.cpp +++ b/nano/node/json_handler.cpp @@ -1575,7 +1575,7 @@ void nano::json_handler::block_create () if (work == 0) { // Difficulty calculation - if (!request.get_optional ("difficulty").is_initialized ()) + if (request.count ("difficulty") == 0) { nano::block_details details (nano::epoch::epoch_0, false, false, false); bool details_found (false);