Skip to content

Commit

Permalink
wallet-rpc: log queries.
Browse files Browse the repository at this point in the history
node-rpc: remove non-existent command.
  • Loading branch information
nodech committed Mar 17, 2021
1 parent b66085a commit 35aa390
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 3 additions & 4 deletions lib/node/rpc.js
Expand Up @@ -106,7 +106,7 @@ class RPC extends RPCBase {
this.pool = node.pool;
this.fees = node.fees;
this.miner = node.miner;
this.logger = node.logger.context('rpc');
this.logger = node.logger.context('node-rpc');
this.locker = new Lock();

this.mining = false;
Expand Down Expand Up @@ -139,10 +139,9 @@ class RPC extends RPCBase {
&& cmd.method !== 'getblocktemplate'
&& cmd.method !== 'getbestblockhash') {
this.logger.debug('Handling RPC call: %s.', cmd.method);
if (cmd.method !== 'submitblock'
&& cmd.method !== 'getmemorypool') {

if (cmd.method !== 'submitblock')
this.logger.debug(cmd.params);
}
}

if (cmd.method === 'getwork') {
Expand Down
11 changes: 10 additions & 1 deletion lib/wallet/rpc.js
Expand Up @@ -92,7 +92,7 @@ class RPC extends RPCBase {

this.wdb = node.wdb;
this.network = node.network;
this.logger = node.logger.context('rpc');
this.logger = node.logger.context('wallet-rpc');
this.client = node.client;
this.locker = new Lock();

Expand All @@ -116,6 +116,15 @@ class RPC extends RPCBase {
}
}

handleCall(cmd, query) {
this.logger.debug('Handling RPC call: %s.', cmd.method);
}

handleError(err) {
this.logger.error('RPC internal error.');
this.logger.error(err);
}

init() {
this.add('help', this.help);
this.add('stop', this.stop);
Expand Down

0 comments on commit 35aa390

Please sign in to comment.