3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-30 23:02:15 +00:00

Allow NotFoundMessage to be constructed with a list of InventoryItems.

This commit is contained in:
Mike Hearn 2013-01-20 22:17:22 +01:00
parent 8b9ddd2caf
commit bfcf67ee5a
2 changed files with 10 additions and 2 deletions

View File

@ -30,9 +30,9 @@ public abstract class ListMessage extends Message {
private long arrayLen;
// 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 {

View File

@ -16,6 +16,9 @@
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
* 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 {
super(params, payloadBytes);
}
public NotFoundMessage(NetworkParameters unitTestParams, List<InventoryItem> items) {
super(unitTestParams);
this.items = new ArrayList<InventoryItem>(items);
}
}