Skip to content

Commit

Permalink
Use count to find out if difficulty is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
SergiySW committed Apr 6, 2020
1 parent 0394280 commit 9fceedf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nano/node/json_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ void nano::json_handler::block_create ()
if (work == 0)
{
// Difficulty calculation
if (!request.get_optional<std::string> ("difficulty").is_initialized ())
if (request.count ("difficulty") == 0)
{
nano::block_details details (nano::epoch::epoch_0, false, false, false);
bool details_found (false);
Expand Down

0 comments on commit 9fceedf

Please sign in to comment.