Console: Show offline expiration on LS debug page

This commit is contained in:
zzz
2020-11-02 12:01:58 +00:00
parent a21a64e0c6
commit 057eca56d5
2 changed files with 17 additions and 3 deletions

View File

@@ -597,10 +597,15 @@ class NetDbRenderer {
if (type != DatabaseEntry.KEY_TYPE_LEASESET) {
LeaseSet2 ls2 = (LeaseSet2) ls;
buf.append("&nbsp;&nbsp;<b>Unpublished? </b>").append(ls2.isUnpublished());
boolean isOff = ls2.isOffline();
buf.append("&nbsp;&nbsp;<b>Offline signed? </b>").append(isOff);
if (isOff)
if (ls2.isOffline()) {
buf.append("&nbsp;&nbsp;<b>Offline signed: </b>");
exp = ls2.getTransientExpiration() - now;
if (exp > 0)
buf.append(_t("Expires in {0}", DataHelper.formatDuration2(exp)));
else
buf.append(_t("Expired {0} ago", DataHelper.formatDuration2(0-exp)));
buf.append("&nbsp;&nbsp;<b>Type: </b>").append(ls2.getTransientSigningKey().getType());
}
}
buf.append("</td></tr>\n<tr><td colspan=\"2\">");
//buf.append(dest.toBase32()).append("<br>");

View File

@@ -252,6 +252,15 @@ public class LeaseSet2 extends LeaseSet {
return _transientSigningPublicKey;
}
/**
* Absolute time, not time from now.
* @return transient expiration time or 0 if not offline signed
* @since 0.9.48
*/
public long getTransientExpiration() {
return _transientExpires;
}
/**
* Destination must be previously set.
*