Respond to pinning RPCs as soon as possible

(instead of waiting until you've read an unbounded number
of pin logs while queries back up in memory)

Also replace instances of 'publicKey' with 'safeKey' or 'unsafeKey'
to clearly and correctly indicate their format.
This commit is contained in:
ansuz
2020-02-14 13:46:40 -05:00
parent cded52f83f
commit 38c1700173
3 changed files with 193 additions and 96 deletions

View File

@@ -2,7 +2,6 @@
const nThen = require("nthen");
const Util = require("./common-util");
const mkEvent = Util.mkEvent;
const Core = require("./commands/core");
const Admin = require("./commands/admin-rpc");
@@ -219,9 +218,14 @@ RPC.create = function (config, cb) {
Sessions: {},
paths: {},
msgStore: config.store,
pinStore: undefined,
pinnedPads: {},
evPinnedPadsReady: mkEvent(true),
pinsLoaded: false,
pendingPinInquiries: {},
pendingUnpins: {},
pinWorkers: 5,
limits: {},
admins: [],
Log: Log,