forked from I2P_Developers/i2p.i2p
Console: Show offline expiration on LS debug page
This commit is contained in:
@@ -597,10 +597,15 @@ class NetDbRenderer {
|
|||||||
if (type != DatabaseEntry.KEY_TYPE_LEASESET) {
|
if (type != DatabaseEntry.KEY_TYPE_LEASESET) {
|
||||||
LeaseSet2 ls2 = (LeaseSet2) ls;
|
LeaseSet2 ls2 = (LeaseSet2) ls;
|
||||||
buf.append(" <b>Unpublished? </b>").append(ls2.isUnpublished());
|
buf.append(" <b>Unpublished? </b>").append(ls2.isUnpublished());
|
||||||
boolean isOff = ls2.isOffline();
|
if (ls2.isOffline()) {
|
||||||
buf.append(" <b>Offline signed? </b>").append(isOff);
|
buf.append(" <b>Offline signed: </b>");
|
||||||
if (isOff)
|
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(" <b>Type: </b>").append(ls2.getTransientSigningKey().getType());
|
buf.append(" <b>Type: </b>").append(ls2.getTransientSigningKey().getType());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
buf.append("</td></tr>\n<tr><td colspan=\"2\">");
|
buf.append("</td></tr>\n<tr><td colspan=\"2\">");
|
||||||
//buf.append(dest.toBase32()).append("<br>");
|
//buf.append(dest.toBase32()).append("<br>");
|
||||||
|
|||||||
@@ -252,6 +252,15 @@ public class LeaseSet2 extends LeaseSet {
|
|||||||
return _transientSigningPublicKey;
|
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.
|
* Destination must be previously set.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user