mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-01-18 21:32:35 +01:00
HeadersMessage: remove params
from constructors
This commit is contained in:
parent
c613a7d98a
commit
f2fa39ef3e
@ -247,7 +247,7 @@ public class BitcoinSerializer extends MessageSerializer {
|
||||
check(!payload.hasRemaining(), ProtocolException::new);
|
||||
return new VersionAck();
|
||||
} else if (command.equals("headers")) {
|
||||
return new HeadersMessage(params, payload);
|
||||
return new HeadersMessage(payload);
|
||||
} else if (command.equals("filterload")) {
|
||||
return makeBloomFilter(payload);
|
||||
} else if (command.equals("notfound")) {
|
||||
|
@ -44,17 +44,17 @@ public class HeadersMessage extends Message {
|
||||
|
||||
private List<Block> blockHeaders;
|
||||
|
||||
public HeadersMessage(NetworkParameters params, ByteBuffer payload) throws ProtocolException {
|
||||
super(params, payload);
|
||||
public HeadersMessage(ByteBuffer payload) throws ProtocolException {
|
||||
super(payload);
|
||||
}
|
||||
|
||||
public HeadersMessage(NetworkParameters params, Block... headers) throws ProtocolException {
|
||||
super(params);
|
||||
public HeadersMessage(Block... headers) throws ProtocolException {
|
||||
super();
|
||||
blockHeaders = Arrays.asList(headers);
|
||||
}
|
||||
|
||||
public HeadersMessage(NetworkParameters params, List<Block> headers) throws ProtocolException {
|
||||
super(params);
|
||||
public HeadersMessage(List<Block> headers) throws ProtocolException {
|
||||
super();
|
||||
blockHeaders = headers;
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ public class BitcoindComparisonTool {
|
||||
}
|
||||
if (!found)
|
||||
sendHeaders = headers;
|
||||
bitcoind.sendMessage(new HeadersMessage(PARAMS, sendHeaders));
|
||||
bitcoind.sendMessage(new HeadersMessage(sendHeaders));
|
||||
InventoryMessage i = new InventoryMessage();
|
||||
for (Block b : sendHeaders)
|
||||
i.addBlock(b);
|
||||
|
@ -477,7 +477,7 @@ public class PeerTest extends TestWithNetworkConnections {
|
||||
assertEquals(getheaders.getLocator(), expectedLocator);
|
||||
assertEquals(getheaders.getStopHash(), Sha256Hash.ZERO_HASH);
|
||||
// Now send all the headers.
|
||||
HeadersMessage headers = new HeadersMessage(TESTNET, b2.cloneAsHeader(),
|
||||
HeadersMessage headers = new HeadersMessage(b2.cloneAsHeader(),
|
||||
b3.cloneAsHeader(), b4.cloneAsHeader());
|
||||
// We expect to be asked for b3 and b4 again, but this time, with a body.
|
||||
expectedLocator = new BlockLocator();
|
||||
|
Loading…
Reference in New Issue
Block a user