NetDB: Track client that requested LS

OCMOSJ: Don't send to a RAP LS
This commit is contained in:
zzz
2020-08-01 12:36:31 +00:00
parent d1bdeae596
commit d73b327fd0
7 changed files with 97 additions and 12 deletions

View File

@ -70,6 +70,7 @@ public class LeaseSet extends DatabaseEntry {
protected final List<Lease> _leases;
protected boolean _receivedAsPublished;
private boolean _receivedAsReply;
private Hash _receivedBy;
// Store these since isCurrent() and getEarliestLeaseDate() are called frequently
private long _firstExpiration;
protected long _lastExpiration;
@ -198,9 +199,30 @@ public class LeaseSet extends DatabaseEntry {
*/
public boolean getReceivedAsReply() { return _receivedAsReply; }
/** set to true @since 0.7.14 */
/**
* set to true
* @since 0.7.14
*/
public void setReceivedAsReply() { _receivedAsReply = true; }
/**
* The Hash of the local client that received this LS,
* null if the router or unknown.
*
* @since 0.9.47
*/
public Hash getReceivedBy() { return _receivedBy; }
/**
* Also sets receivedAsReply to true
* @param localClient may be null
* @since 0.9.47
*/
public void setReceivedBy(Hash localClient) {
_receivedAsReply = true;
_receivedBy = localClient;
}
/**
* @throws IllegalStateException if already signed
*/