http: require api key for new websocket calls.
This commit is contained in:
parent
9988123b61
commit
ae2573bc57
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user