Used wrong nonce for version message
This commit is contained in:
parent
505818a712
commit
cd3a801704
@ -146,7 +146,7 @@ public abstract class AbstractConnection {
|
|||||||
List<InventoryVector> missing = ctx.getInventory().getMissing(inv.getInventory(), streams);
|
List<InventoryVector> missing = ctx.getInventory().getMissing(inv.getInventory(), streams);
|
||||||
missing.removeAll(commonRequestedObjects);
|
missing.removeAll(commonRequestedObjects);
|
||||||
LOG.debug("Received inventory with " + originalSize + " elements, of which are "
|
LOG.debug("Received inventory with " + originalSize + " elements, of which are "
|
||||||
+ missing.size() + " missing.");
|
+ missing.size() + " missing.");
|
||||||
send(new GetData.Builder().inventory(missing).build());
|
send(new GetData.Builder().inventory(missing).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,8 +197,8 @@ public abstract class AbstractConnection {
|
|||||||
|
|
||||||
public void offer(InventoryVector iv) {
|
public void offer(InventoryVector iv) {
|
||||||
sendingQueue.offer(new Inv.Builder()
|
sendingQueue.offer(new Inv.Builder()
|
||||||
.addInventoryVector(iv)
|
.addInventoryVector(iv)
|
||||||
.build());
|
.build());
|
||||||
updateIvCache(Collections.singletonList(iv));
|
updateIvCache(Collections.singletonList(iv));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,7 +235,7 @@ public abstract class AbstractConnection {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new NodeException("Command 'version' or 'verack' expected, but was '"
|
throw new NodeException("Command 'version' or 'verack' expected, but was '"
|
||||||
+ payload.getCommand() + "'");
|
+ payload.getCommand() + "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,8 +259,8 @@ public abstract class AbstractConnection {
|
|||||||
List<InventoryVector> inventory = ctx.getInventory().getInventory(streams);
|
List<InventoryVector> inventory = ctx.getInventory().getInventory(streams);
|
||||||
for (int i = 0; i < inventory.size(); i += 50000) {
|
for (int i = 0; i < inventory.size(); i += 50000) {
|
||||||
sendingQueue.offer(new Inv.Builder()
|
sendingQueue.offer(new Inv.Builder()
|
||||||
.inventory(inventory.subList(i, Math.min(inventory.size(), i + 50000)))
|
.inventory(inventory.subList(i, Math.min(inventory.size(), i + 50000)))
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ class Connection extends AbstractConnection {
|
|||||||
try (Socket socket = Connection.this.socket) {
|
try (Socket socket = Connection.this.socket) {
|
||||||
initSocket(socket);
|
initSocket(socket);
|
||||||
if (mode == CLIENT || mode == SYNC) {
|
if (mode == CLIENT || mode == SYNC) {
|
||||||
send(new Version.Builder().defaults(peerNonce).addrFrom(host).addrRecv(node).build());
|
send(new Version.Builder().defaults(ctx.getClientNonce()).addrFrom(host).addrRecv(node).build());
|
||||||
}
|
}
|
||||||
while (state != DISCONNECTED) {
|
while (state != DISCONNECTED) {
|
||||||
if (mode != SYNC) {
|
if (mode != SYNC) {
|
||||||
|
@ -52,7 +52,7 @@ public class ConnectionInfo extends AbstractConnection {
|
|||||||
super(context, mode, node, listener, commonRequestedObjects, syncTimeout);
|
super(context, mode, node, listener, commonRequestedObjects, syncTimeout);
|
||||||
headerOut.flip();
|
headerOut.flip();
|
||||||
if (mode == CLIENT || mode == SYNC) {
|
if (mode == CLIENT || mode == SYNC) {
|
||||||
send(new Version.Builder().defaults(peerNonce).addrFrom(host).addrRecv(node).build());
|
send(new Version.Builder().defaults(ctx.getClientNonce()).addrFrom(host).addrRecv(node).build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user