mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-07 06:44:16 +00:00
Allow NotFoundMessage to be constructed with a list of InventoryItems.
This commit is contained in:
parent
8b9ddd2caf
commit
bfcf67ee5a
@ -30,9 +30,9 @@ public abstract class ListMessage extends Message {
|
|||||||
|
|
||||||
private long arrayLen;
|
private long arrayLen;
|
||||||
// For some reason the compiler complains if this is inside InventoryItem
|
// For some reason the compiler complains if this is inside InventoryItem
|
||||||
private List<InventoryItem> items;
|
protected List<InventoryItem> items;
|
||||||
|
|
||||||
private static final long MAX_INVENTORY_ITEMS = 50000;
|
public static final long MAX_INVENTORY_ITEMS = 50000;
|
||||||
|
|
||||||
|
|
||||||
public ListMessage(NetworkParameters params, byte[] bytes) throws ProtocolException {
|
public ListMessage(NetworkParameters params, byte[] bytes) throws ProtocolException {
|
||||||
|
@ -16,6 +16,9 @@
|
|||||||
|
|
||||||
package com.google.bitcoin.core;
|
package com.google.bitcoin.core;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sent by a peer when a getdata request doesn't find the requested data in the mempool. It has the same format
|
* Sent by a peer when a getdata request doesn't find the requested data in the mempool. It has the same format
|
||||||
* as an inventory message and lists the hashes of the missing items.
|
* as an inventory message and lists the hashes of the missing items.
|
||||||
@ -28,4 +31,9 @@ public class NotFoundMessage extends InventoryMessage {
|
|||||||
public NotFoundMessage(NetworkParameters params, byte[] payloadBytes) throws ProtocolException {
|
public NotFoundMessage(NetworkParameters params, byte[] payloadBytes) throws ProtocolException {
|
||||||
super(params, payloadBytes);
|
super(params, payloadBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NotFoundMessage(NetworkParameters unitTestParams, List<InventoryItem> items) {
|
||||||
|
super(unitTestParams);
|
||||||
|
this.items = new ArrayList<InventoryItem>(items);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user