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.
|
||||
* @param {Hash|Number} block
|
||||
* @param {Number} height
|
||||
* @returns {Promise}
|
||||
*/
|
||||
|
||||
HTTPClient.prototype.reset = function reset(block) {
|
||||
var options = { block: block };
|
||||
return this._post('/_admin/reset', options);
|
||||
HTTPClient.prototype.reset = function reset(height) {
|
||||
var options = { height: height };
|
||||
return this._post('/reset', options);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@ -340,7 +340,7 @@ HTTPServer.prototype.initRouter = function initRouter() {
|
||||
var valid = req.valid();
|
||||
var height = valid.u32('height');
|
||||
|
||||
enforce(height != null, 'Hash or height is required.');
|
||||
enforce(height != null, 'Height is required.');
|
||||
|
||||
yield this.chain.reset(height);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user