From 5d4ef719b9763ce9c150b93d61e541f5bbc1bbb9 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Tue, 1 Aug 2017 14:06:12 +0100 Subject: [PATCH] core: speed up output index unique set calculation A sort+uniq step was done for every tx in a 200 block chunk, causing a lot of repeated scanning as the size of the offset map got larger with every added tx. We now do the step only once at the end of the loop. Doing it this way potentially uses more memory, but testing shows that it's currently only about 2% more. --- src/cryptonote_core/blockchain.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 745608b9..2420adc5 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -3866,17 +3866,17 @@ bool Blockchain::prepare_handle_incoming_blocks(const std::list> transactions(amounts.size());