Add DB method for checking whether there's anything to send

This commit is contained in:
akwizgran
2021-06-16 16:25:11 +01:00
committed by Torsten Grote
parent 4cf5242aa5
commit 796cbcaf4b
5 changed files with 191 additions and 97 deletions

View File

@@ -118,6 +118,18 @@ public interface DatabaseComponent extends TransactionManager {
KeySetId addTransportKeys(Transaction txn, PendingContactId p,
TransportKeys k) throws DbException;
/**
* Returns true if there are any acks or messages to send to the given
* contact over a transport with the given maximum latency.
* <p/>
* Read-only.
*
* @param eager True if messages that are not yet due for retransmission
* should be included
*/
boolean containsAnythingToSend(Transaction txn, ContactId c,
int maxLatency, boolean eager) throws DbException;
/**
* Returns true if the database contains the given contact for the given
* local pseudonym.