diff --git a/lib/http/server.js b/lib/http/server.js index e6dac03b..1fe7ece0 100644 --- a/lib/http/server.js +++ b/lib/http/server.js @@ -274,7 +274,11 @@ HTTPServer.prototype.initRouter = function initRouter() { 'Hash or height required.'); enforce(!this.chain.options.spv, 'Cannot get block in SPV mode.'); - hash = util.revHex(hash); + if (hash.length === 64) + hash = util.revHex(hash); + else + hash = +hash; + block = yield this.chain.db.getBlock(hash); if (!block) {