@@ -52,6 +52,7 @@ TransactionAcquire::TransactionAcquire(
5252 app.journal(" TransactionAcquire" ))
5353 , mHaveRoot (false )
5454 , mPeerSet (std::move(peerSet))
55+ , startTime_(std::chrono::steady_clock::now())
5556{
5657 mMap = std::make_shared<SHAMap>(
5758 SHAMapType::TRANSACTION, hash, app_.getNodeFamily ());
@@ -65,11 +66,21 @@ TransactionAcquire::done()
6566
6667 if (failed_)
6768 {
68- JLOG (journal_.debug ()) << " Failed to acquire TX set " << hash_;
69+ JLOG (journal_.debug ()) << " ACQUIRE done Failed to acquire TX set " << hash_
70+ << " duration " << to_string (std::chrono::duration_cast<std::chrono::nanoseconds>(
71+ std::chrono::steady_clock::now () - startTime_).count ()) << " ns total nodes " << nodeCount_
72+ << " total peers " << mPeerSet ->getPeerIds ().size ()
73+ << " peers " << mPeerSet ->to_string ();
74+
6975 }
7076 else
7177 {
72- JLOG (journal_.debug ()) << " Acquired TX set " << hash_;
78+ JLOG (journal_.debug ()) << " ACQUIRE done Acquired TX set " << hash_
79+ << " duration " << to_string (std::chrono::duration_cast<std::chrono::nanoseconds>(
80+ std::chrono::steady_clock::now () - startTime_).count ()) << " ns total nodes " << nodeCount_
81+ << " total peers " << mPeerSet ->getPeerIds ().size ()
82+ << " peers " << mPeerSet ->to_string ();
83+
7384 mMap ->setImmutable ();
7485
7586 uint256 const & hash (hash_);
@@ -101,6 +112,8 @@ TransactionAcquire::onTimer(bool progress, ScopedLockType& psl)
101112 trigger (nullptr );
102113
103114 addPeers (1 );
115+ JLOG (journal_.debug ()) << " ACQUIRE onTimer " << hash_ << " num peers: " << mPeerSet ->getPeerIds ().size ()
116+ << " peers " << mPeerSet ->to_string ();
104117}
105118
106119std::weak_ptr<TimeoutCounter>
@@ -137,6 +150,7 @@ TransactionAcquire::trigger(std::shared_ptr<Peer> const& peer)
137150
138151 *(tmGL.add_nodeids ()) = SHAMapNodeID ().getRawString ();
139152 mPeerSet ->sendRequest (tmGL, peer);
153+ JLOG (journal_.debug ()) << " ACQUIRE trigger " << hash_ << " no root sending to: " << peer.get ()->id ();
140154 }
141155 else if (!mMap ->isValid ())
142156 {
@@ -171,6 +185,9 @@ TransactionAcquire::trigger(std::shared_ptr<Peer> const& peer)
171185 *tmGL.add_nodeids () = node.first .getRawString ();
172186 }
173187 mPeerSet ->sendRequest (tmGL, peer);
188+ nodeCount_ += nodes.size ();
189+ JLOG (journal_.debug ()) << " ACQUIRE trigger " << hash_ << " need " << nodes.size ()
190+ << " nodes sending to: " << peer.get ()->id ();
174191 }
175192}
176193
@@ -225,6 +242,8 @@ TransactionAcquire::takeNodes(
225242
226243 trigger (peer);
227244 progress_ = true ;
245+ JLOG (journal_.debug ()) << " ACQUIRE takeNodes " << hash_ << " got " << data.size ()
246+ << " nodes from " << peer.get ()->id ();
228247 return SHAMapAddNode::useful ();
229248 }
230249 catch (std::exception const & ex)
@@ -251,6 +270,8 @@ TransactionAcquire::init(int numPeers)
251270 ScopedLockType sl (mtx_);
252271
253272 addPeers (numPeers);
273+ JLOG (journal_.debug ()) << " ACQUIRE init " << hash_ << " num peers: " << mPeerSet ->getPeerIds ().size ()
274+ << " peers " << mPeerSet ->to_string ();
254275
255276 setTimer (sl);
256277}
0 commit comments