mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-11 17:55:53 +00:00
Fix a minor bug in AddressMessage. Patch from Vasile Rotaru. Resolves issue 138.
This commit is contained in:
parent
03db1a9636
commit
21c5e14700
1
AUTHORS
1
AUTHORS
@ -12,3 +12,4 @@ Jonny Heggheim <hegjon@gmail.com>
|
|||||||
Steve Coughlan <shadders.del@gmail.com>
|
Steve Coughlan <shadders.del@gmail.com>
|
||||||
Roman Mandeleil <roman.mandeleil@gmail.com>
|
Roman Mandeleil <roman.mandeleil@gmail.com>
|
||||||
Chris Rico <chrisrico@gmail.com>
|
Chris Rico <chrisrico@gmail.com>
|
||||||
|
Vasile Rotaru <vrotaru.md@gmail.com>
|
@ -89,16 +89,15 @@ public class AddressMessage extends Message {
|
|||||||
for (PeerAddress addr : addresses) {
|
for (PeerAddress addr : addresses) {
|
||||||
addr.bitcoinSerialize(stream);
|
addr.bitcoinSerialize(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int getMessageSize() {
|
int getMessageSize() {
|
||||||
if (length != UNKNOWN_LENGTH)
|
if (length != UNKNOWN_LENGTH)
|
||||||
return length;
|
return length;
|
||||||
length = new VarInt(addresses.size()).getSizeInBytes();
|
|
||||||
if (addresses != null) {
|
if (addresses != null) {
|
||||||
// The 4 byte difference is the uint32 timestamp that was introduced in version 31402
|
length = new VarInt(addresses.size()).getSizeInBytes();
|
||||||
length += addresses.size() * (protocolVersion > 31402 ? PeerAddress.MESSAGE_SIZE : PeerAddress.MESSAGE_SIZE - 4);
|
// The 4 byte difference is the uint32 timestamp that was introduced in version 31402
|
||||||
|
length += addresses.size() * (protocolVersion > 31402 ? PeerAddress.MESSAGE_SIZE : PeerAddress.MESSAGE_SIZE - 4);
|
||||||
}
|
}
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user