Fixed synchronization
This commit is contained in:
parent
ac6f291964
commit
35077243b0
@ -350,7 +350,7 @@ class Connection {
|
|||||||
send(new Version.Builder().defaults().addrFrom(host).addrRecv(node).build());
|
send(new Version.Builder().defaults().addrFrom(host).addrRecv(node).build());
|
||||||
}
|
}
|
||||||
while (state != DISCONNECTED) {
|
while (state != DISCONNECTED) {
|
||||||
if (requestedObjects.isEmpty()) {
|
if (mode != SYNC && state == ACTIVE && requestedObjects.isEmpty()) {
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
} else {
|
} else {
|
||||||
Thread.sleep(100);
|
Thread.sleep(100);
|
||||||
|
@ -94,7 +94,7 @@ public class NetworkHandlerTest {
|
|||||||
} while (node.isRunning());
|
} while (node.isRunning());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(timeout = 20_000)
|
@Test(timeout = 5_000)
|
||||||
public void ensureNodesAreConnecting() {
|
public void ensureNodesAreConnecting() {
|
||||||
try {
|
try {
|
||||||
node.startup();
|
node.startup();
|
||||||
@ -109,7 +109,7 @@ public class NetworkHandlerTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(timeout = 10_000)
|
@Test(timeout = 5_000)
|
||||||
public void ensureObjectsAreSynchronizedIfBothHaveObjects() throws Exception {
|
public void ensureObjectsAreSynchronizedIfBothHaveObjects() throws Exception {
|
||||||
peerInventory.init(
|
peerInventory.init(
|
||||||
"V4Pubkey.payload",
|
"V4Pubkey.payload",
|
||||||
@ -128,7 +128,7 @@ public class NetworkHandlerTest {
|
|||||||
assertInventorySize(3, peerInventory);
|
assertInventorySize(3, peerInventory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(timeout = 10_000)
|
@Test(timeout = 5_000)
|
||||||
public void ensureObjectsAreSynchronizedIfOnlyPeerHasObjects() throws Exception {
|
public void ensureObjectsAreSynchronizedIfOnlyPeerHasObjects() throws Exception {
|
||||||
peerInventory.init(
|
peerInventory.init(
|
||||||
"V4Pubkey.payload",
|
"V4Pubkey.payload",
|
||||||
@ -145,7 +145,7 @@ public class NetworkHandlerTest {
|
|||||||
assertInventorySize(2, peerInventory);
|
assertInventorySize(2, peerInventory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(timeout = 10_000)
|
@Test(timeout = 5_000)
|
||||||
public void ensureObjectsAreSynchronizedIfOnlyNodeHasObjects() throws Exception {
|
public void ensureObjectsAreSynchronizedIfOnlyNodeHasObjects() throws Exception {
|
||||||
peerInventory.init();
|
peerInventory.init();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user