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))
|
if (blocks != null && !utils.isNumber(blocks))
|
||||||
return callback({ error: 'Invalid parameter.' });
|
return callback({ error: 'Invalid parameter.' });
|
||||||
|
|
||||||
|
if (!socket.api)
|
||||||
|
return callback({ error: 'Not authorized.' });
|
||||||
|
|
||||||
if (!self.fees) {
|
if (!self.fees) {
|
||||||
rate = self.network.feeRate;
|
rate = self.network.feeRate;
|
||||||
rate = utils.btc(rate);
|
rate = utils.btc(rate);
|
||||||
@ -1288,6 +1291,9 @@ HTTPServer.prototype._initIO = function _initIO() {
|
|||||||
if (!utils.isHex(data))
|
if (!utils.isHex(data))
|
||||||
return callback({ error: 'Invalid parameter.' });
|
return callback({ error: 'Invalid parameter.' });
|
||||||
|
|
||||||
|
if (!socket.api)
|
||||||
|
return callback({ error: 'Not authorized.' });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
tx = TX.fromRaw(data, 'hex');
|
tx = TX.fromRaw(data, 'hex');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user