http: require api key for new websocket calls.

This commit is contained in:
Christopher Jeffrey 2016-10-25 09:16:26 -07:00
parent 9988123b61
commit ae2573bc57
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -1269,6 +1269,9 @@ HTTPServer.prototype._initIO = function _initIO() {
if (blocks != null && !utils.isNumber(blocks))
return callback({ error: 'Invalid parameter.' });
if (!socket.api)
return callback({ error: 'Not authorized.' });
if (!self.fees) {
rate = self.network.feeRate;
rate = utils.btc(rate);
@ -1288,6 +1291,9 @@ HTTPServer.prototype._initIO = function _initIO() {
if (!utils.isHex(data))
return callback({ error: 'Invalid parameter.' });
if (!socket.api)
return callback({ error: 'Not authorized.' });
try {
tx = TX.fromRaw(data, 'hex');
} catch (e) {