From 945c8ca3a12b331fbada1217e52ff8b7f0eb13bb Mon Sep 17 00:00:00 2001 From: clemahieu Date: Thu, 30 Jan 2020 11:35:53 +0000 Subject: [PATCH] Using election attached to iterator. --- nano/node/active_transactions.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nano/node/active_transactions.cpp b/nano/node/active_transactions.cpp index 9e00d79f..d9da6fdb 100644 --- a/nano/node/active_transactions.cpp +++ b/nano/node/active_transactions.cpp @@ -632,12 +632,12 @@ void nano::active_transactions::update_difficulty (std::shared_ptr { node.logger.try_log (boost::str (boost::format ("Block %1% was updated from difficulty %2% to %3%") % block_a->hash ().to_string () % nano::to_string_hex (existing_election->difficulty) % nano::to_string_hex (difficulty))); } - roots.get ().modify (existing_election, [election = existing_election->election, &block_a, difficulty](nano::conflict_info & info_a) { + roots.get ().modify (existing_election, [&block_a, difficulty](nano::conflict_info & info_a) { info_a.difficulty = difficulty; - election->blocks[block_a->hash ()] = block_a; - if (election->status.winner->hash () == block_a->hash ()) + info_a.election->blocks[block_a->hash ()] = block_a; + if (info_a.election->status.winner->hash () == block_a->hash ()) { - election->status.winner = block_a; + info_a.election->status.winner = block_a; } }); adjust_difficulty (block_a->hash ());