http: fix chain resetting for client.
This commit is contained in:
parent
e821eb10bf
commit
db715036aa
@ -391,13 +391,13 @@ HTTPClient.prototype.rescan = function rescan(height) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Reset the chain.
|
* Reset the chain.
|
||||||
* @param {Hash|Number} block
|
* @param {Number} height
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
HTTPClient.prototype.reset = function reset(block) {
|
HTTPClient.prototype.reset = function reset(height) {
|
||||||
var options = { block: block };
|
var options = { height: height };
|
||||||
return this._post('/_admin/reset', options);
|
return this._post('/reset', options);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -340,7 +340,7 @@ HTTPServer.prototype.initRouter = function initRouter() {
|
|||||||
var valid = req.valid();
|
var valid = req.valid();
|
||||||
var height = valid.u32('height');
|
var height = valid.u32('height');
|
||||||
|
|
||||||
enforce(height != null, 'Hash or height is required.');
|
enforce(height != null, 'Height is required.');
|
||||||
|
|
||||||
yield this.chain.reset(height);
|
yield this.chain.reset(height);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user