public synchronized int addTree ( InetAddress endpoint , MerkleTree tree ) { // Wait for all request to have been performed (see #3400) try { requestsSent . await ( ) ; } catch ( InterruptedException e ) { throw new AssertionError ( "Interrupted while waiting for requests to be sent" ) ; } if ( tree == null ) failed = true ; else trees . add ( new TreeResponse ( endpoint , tree ) ) ; return treeRequests . completed ( endpoint ) ; }
Add a new received tree and return the number of remaining tree to be received for the job to be complete .