Add trim history RPC command

This commit is contained in:
yflory
2020-02-05 17:55:25 +01:00
parent 6db7fbac0f
commit e6709f03aa
4 changed files with 21 additions and 19 deletions

View File

@@ -125,6 +125,17 @@ var factory = function (Util, Rpc) {
});
};
exp.trimHistory = function (data, _cb) {
var cb = Util.once(Util.mkAsync(_cb));
if (typeof(data) !== 'object' || !data.channel || !data.hash) {
return void cb('INVALID_ARGUMENTS');
}
rpc.send('TRIM_HISTORY', data, function (e) {
if (e) { return cb(e); }
cb();
});
};
exp.clearOwnedChannel = function (channel, cb) {
if (typeof(channel) !== 'string' || channel.length !== 32) {
return void cb('INVALID_ARGUMENTS');