mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-24 14:50:57 +01:00
Allow NotFoundMessage to be constructed with a list of InventoryItems.
This commit is contained in:
parent
8b9ddd2caf
commit
bfcf67ee5a
2 changed files with 10 additions and 2 deletions
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue