File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
main/java/org/tron/common/overlay/server
test/java/org/tron/core/net/node Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -80,16 +80,13 @@ public class SyncPool {
80
80
81
81
private PeerClient peerClient ;
82
82
83
- @ Autowired
84
- public SyncPool (PeerClient peerClient ) {
85
- this .peerClient = peerClient ;
86
- }
87
-
88
83
public void init (PeerConnectionDelegate peerDel ) {
89
84
this .peerDel = peerDel ;
90
85
91
86
channelManager = ctx .getBean (ChannelManager .class );
92
87
88
+ peerClient = ctx .getBean (PeerClient .class );
89
+
93
90
poolLoopExecutor .scheduleWithFixedDelay (() -> {
94
91
try {
95
92
fillUp ();
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ public void testDisconnectInactive() {
192
192
peer3 .setSyncBlockRequested (syncBlockRequested3 );
193
193
194
194
// fetch failed
195
- SyncPool pool = new SyncPool (new PeerClient () );
195
+ SyncPool pool = new SyncPool ();
196
196
pool .addActivePeers (peer1 );
197
197
nodeImpl .setPool (pool );
198
198
try {
@@ -203,7 +203,7 @@ public void testDisconnectInactive() {
203
203
}
204
204
205
205
// sync failed
206
- pool = new SyncPool (new PeerClient () );
206
+ pool = new SyncPool ();
207
207
pool .addActivePeers (peer2 );
208
208
nodeImpl .setPool (pool );
209
209
try {
@@ -214,7 +214,7 @@ public void testDisconnectInactive() {
214
214
}
215
215
216
216
// should not disconnect
217
- pool = new SyncPool (new PeerClient () );
217
+ pool = new SyncPool ();
218
218
pool .addActivePeers (peer3 );
219
219
nodeImpl .setPool (pool );
220
220
try {
You can’t perform that action at this time.
0 commit comments