mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-01 07:42:17 +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>
|
||||
Roman Mandeleil <roman.mandeleil@gmail.com>
|
||||
Chris Rico <chrisrico@gmail.com>
|
||||
Vasile Rotaru <vrotaru.md@gmail.com>
|
@ -89,14 +89,13 @@ public class AddressMessage extends Message {
|
||||
for (PeerAddress addr : addresses) {
|
||||
addr.bitcoinSerialize(stream);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int getMessageSize() {
|
||||
if (length != UNKNOWN_LENGTH)
|
||||
return length;
|
||||
length = new VarInt(addresses.size()).getSizeInBytes();
|
||||
if (addresses != null) {
|
||||
length = new VarInt(addresses.size()).getSizeInBytes();
|
||||
// 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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user