Skip to content
This repository was archived by the owner on Feb 12, 2025. It is now read-only.

Commit 964a6d2

Browse files
Merge pull request #789 from LedgerHQ/hzheng-ledger-patch-1
Add some debug log
2 parents 130929e + 96044ce commit 964a6d2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

core/src/wallet/bitcoin/synchronizers/BlockchainExplorerAccountSynchronizer.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <async/algorithm.h>
3535
#include <async/FutureUtils.hpp>
3636
#include <debug/Benchmarker.h>
37+
#include <iostream>
3738

3839
#define NEW_BENCHMARK(x) std::make_shared<Benchmarker>(fmt::format(x"/{}", buddy->synchronizationTag), buddy->logger)
3940

@@ -693,21 +694,34 @@ namespace ledger {
693694
lastBlock.getValue().height < tx.block.getValue().height) {
694695
lastBlock = tx.block;
695696
}
697+
std::cout << "transaction intepretation begin" << std::endl;
696698
self->interpretTransaction(tx, buddy, operations);
699+
std::cout << "transaction intepretation end" << std::endl;
697700
//Update first pendingTxHash in savedState
698701
auto it = buddy->transactionsToDrop.find(tx.hash);
702+
std::cout << "tx.hash" << std::endl;
703+
std::cout << tx.hash << std::endl;
704+
std::cout << buddy->transactionsToDrop.size() << std::endl;
699705
if (it != buddy->transactionsToDrop.end()) {
706+
std::cout << "transactionToDrop found" << std::endl;
700707
//If block non empty, tx is no longer pending
701708
if (tx.block.nonEmpty()) {
709+
std::cout << "erase" << std::endl;
702710
buddy->savedState.getValue().pendingTxsHash.erase(it->first);
711+
std::cout << "erase finish" << std::endl;
703712
}
704713
else { //Otherwise tx is in mempool but pending
714+
std::cout << "insert to mempool" << std::endl;
705715
buddy->savedState.getValue().pendingTxsHash.insert(std::pair<std::string, std::string>(it->first, it->second));
716+
std::cout << "insert to mempool finish" << std::endl;
706717
}
707718
}
708719
//Remove from tx to drop
720+
std::cout << "Remove from tx to drop" << std::endl;
709721
buddy->transactionsToDrop.erase(tx.hash);
722+
std::cout << "Remove from tx to drop finish" << std::endl;
710723
}
724+
std::cout << "Succeed to insert transactions" << std::endl;
711725
interpretBenchmark->stop();
712726
auto insertionBenchmark = NEW_BENCHMARK("insert_operations");
713727
insertionBenchmark->start();

0 commit comments

Comments
 (0)