diff --git a/lib/index.js b/lib/index.js index 361c357..1777e8d 100644 --- a/lib/index.js +++ b/lib/index.js @@ -225,7 +225,7 @@ exports.init = function initDB(peer, config) { const keys = opts.keys ?? config.keys const { group, type } = opts - const feedRootHash = getFeedRoot(group, type) + const feedRootHash = getFeedId(group, type) if (feedRootHash) return cb(null, feedRootHash) const feedRoot = MsgV2.createRoot(group, type, keys) @@ -354,7 +354,7 @@ exports.init = function initDB(peer, config) { }) } - function getFeedRoot(groupId, findType) { + function getFeedId(groupId, findType) { const findGroup = MsgV2.stripGroup(groupId) for (const rec of records()) { if (MsgV2.isFeedRoot(rec.msg, findGroup, findType)) return rec.hash @@ -429,7 +429,7 @@ exports.init = function initDB(peer, config) { }, feed: { publish: publishToFeed, - getRoot: getFeedRoot, + getId: getFeedId, }, getRecord, get,