i2psnark: Add another method to support RPC plugin

This commit is contained in:
zzz
2017-03-21 11:57:52 +00:00
parent 13ad5d72ae
commit a00f11d5b7
3 changed files with 17 additions and 1 deletions

View File

@ -239,6 +239,7 @@ public class Snark
// String indicating main activity // String indicating main activity
private volatile String activity = "Not started"; private volatile String activity = "Not started";
private final long savedUploaded; private final long savedUploaded;
private long _startedTime;
private static final AtomicInteger __RPCID = new AtomicInteger(); private static final AtomicInteger __RPCID = new AtomicInteger();
private final int _rpcID = __RPCID.incrementAndGet(); private final int _rpcID = __RPCID.incrementAndGet();
@ -544,6 +545,7 @@ public class Snark
starting = true; starting = true;
try { try {
x_startTorrent(); x_startTorrent();
_startedTime = _util.getContext().clock().now();
} finally { } finally {
starting = false; starting = false;
} }
@ -1375,4 +1377,14 @@ public class Snark
public int getRPCID() { public int getRPCID() {
return _rpcID; return _rpcID;
} }
/**
* When did we start this torrent
* For RPC
* @return 0 if not started before. Not cleared when stopped.
* @since 0.9.30
*/
public long getStartedTime() {
return _startedTime;
}
} }

View File

@ -1,5 +1,9 @@
2017-03-21 zzz
* i2psnark: Enhancement to support RPC plugin
2017-03-20 zzz 2017-03-20 zzz
* i2psnark: Enhancements to support RPC plugin * i2psnark: Enhancements to support RPC plugin
* SSU: More work on introducer expiration (proposal 133)
2017-03-18 zzz 2017-03-18 zzz
* Addressbook (ticket #1966): * Addressbook (ticket #1966):

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 8; public final static long BUILD = 9;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = ""; public final static String EXTRA = "";