diff --git a/RELEASES.md b/RELEASES.md
index a1ffa54..6457b94 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -3,6 +3,7 @@
## Releases ##
+- [v1.11.0](#1_11_0)
- [v1.10.1](#1_10_1)
- [v1.10.0](#1_10_0)
- [v1.9.0](#1_9_0)
@@ -17,6 +18,28 @@
- [v1.2.0](#1_2_0)
- [v1.1.0](#1_1_0)
+
+
+## Samourai Dojo v1.11.0 ##
+
+## Breaking ##
+- Dojo now requires Node.js v14
+
+#### Features ####
+
+- [#mr242](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/242) postmix decoy change addresses
+- [#mr241](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/241) update ZeroMQ and Node.js
+- [#mr240](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/240) update Node.js dependencies
+- [#mr239](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/239) update Tor and remove v2 onion addresses
+- [#mr238](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/238) use RPC auth instead of basic auth
+- other minor improvements
+
+#### Bug fixes ####
+
+- [#mr237](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/237) fix tracker initialization
+- [commit 3ee4ecc6](https://code.samourai.io/dojo/samourai-dojo/-/commit/3ee4ecc645dc88632f4e7bfd00fafe602bcaef13) fix importing from local_bitcoind
+- other minor fixes
+
## Samourai Dojo v1.10.1 ##
diff --git a/accounts/api-helper.js b/accounts/api-helper.js
index 243b9d2..42353e8 100644
--- a/accounts/api-helper.js
+++ b/accounts/api-helper.js
@@ -70,7 +70,9 @@ class ApiHelper {
item = item.toLowerCase()
ret.addAddress(item, false)
}
- } catch(e) {}
+ } catch(e) {
+ Logger.error(e, 'API : ApiHelper.parseEntities() : Invalid arguments')
+ }
}
return ret
diff --git a/accounts/fees-rest-api.js b/accounts/fees-rest-api.js
index 77f83fc..a62b705 100644
--- a/accounts/fees-rest-api.js
+++ b/accounts/fees-rest-api.js
@@ -9,7 +9,7 @@ const rpcFees = require('../lib/bitcoind-rpc/fees')
const authMgr = require('../lib/auth/authorizations-manager')
const HttpServer = require('../lib/http-server/http-server')
-const debugApi = !!(process.argv.indexOf('api-debug') > -1)
+const debugApi = process.argv.indexOf('api-debug') > -1
/**
@@ -29,6 +29,11 @@ class FeesRestApi {
authMgr.checkAuthentication.bind(authMgr),
this.getFees.bind(this),
)
+ this.httpServer.app.post(
+ '/fees',
+ authMgr.checkAuthentication.bind(authMgr),
+ this.getFees.bind(this),
+ )
// Refresh the network fees
rpcFees.refresh()
}
diff --git a/accounts/headers-rest-api.js b/accounts/headers-rest-api.js
index 3971e52..63d6e19 100644
--- a/accounts/headers-rest-api.js
+++ b/accounts/headers-rest-api.js
@@ -12,7 +12,7 @@ const authMgr = require('../lib/auth/authorizations-manager')
const HttpServer = require('../lib/http-server/http-server')
const apiHelper = require('./api-helper')
-const debugApi = !!(process.argv.indexOf('api-debug') > -1)
+const debugApi = process.argv.indexOf('api-debug') > -1
/**
diff --git a/accounts/multiaddr-rest-api.js b/accounts/multiaddr-rest-api.js
index 51cc77f..4399a5f 100644
--- a/accounts/multiaddr-rest-api.js
+++ b/accounts/multiaddr-rest-api.js
@@ -12,7 +12,7 @@ const authMgr = require('../lib/auth/authorizations-manager')
const HttpServer = require('../lib/http-server/http-server')
const apiHelper = require('./api-helper')
-const debugApi = !!(process.argv.indexOf('api-debug') > -1)
+const debugApi = process.argv.indexOf('api-debug') > -1
/**
@@ -32,18 +32,20 @@ class MultiaddrRestApi {
const urlencodedParser = bodyParser.urlencoded({ extended: true })
this.httpServer.app.get(
- '/multiaddr',
- authMgr.checkAuthentication.bind(authMgr),
- apiHelper.validateEntitiesParams.bind(apiHelper),
- this.getMultiaddr.bind(this),
+ '/multiaddr',
+ authMgr.checkAuthentication.bind(authMgr),
+ apiHelper.validateEntitiesParams.bind(apiHelper),
+ this.getMultiaddr.bind(this),
+ HttpServer.sendAuthError
)
this.httpServer.app.post(
- '/multiaddr',
- urlencodedParser,
- authMgr.checkAuthentication.bind(authMgr),
- apiHelper.validateEntitiesParams.bind(apiHelper),
- this.postMultiaddr.bind(this),
+ '/multiaddr',
+ urlencodedParser,
+ authMgr.checkAuthentication.bind(authMgr),
+ apiHelper.validateEntitiesParams.bind(apiHelper),
+ this.postMultiaddr.bind(this),
+ HttpServer.sendAuthError
)
}
@@ -57,16 +59,19 @@ class MultiaddrRestApi {
// Check request params
if (!apiHelper.checkEntitiesParams(req.query))
return HttpServer.sendError(res, errors.multiaddr.NOACT)
-
+ //return HttpServer.sendError(res, '')
// Parse params
const entities = apiHelper.parseEntitiesParams(req.query)
+ if (entities.active.addrs.length === 1 || entities.active.addrs.length === 2 || entities.active.xpubs.length === 1)
+ return HttpServer.sendError(res, '')
+
const result = await walletService.getWalletInfo(
- entities.active,
- entities.legacy,
- entities.bip49,
- entities.bip84,
- entities.pubkey
+ entities.active,
+ entities.legacy,
+ entities.bip49,
+ entities.bip84,
+ entities.pubkey
)
const ret = JSON.stringify(result, null, 2)
@@ -78,7 +83,7 @@ class MultiaddrRestApi {
} finally {
if (debugApi) {
const strParams =
- `${req.query.active ? req.query.active : ''} \
+ `${req.query.active ? req.query.active : ''} \
${req.query.new ? req.query.new : ''} \
${req.query.pubkey ? req.query.pubkey : ''} \
${req.query.bip49 ? req.query.bip49 : ''} \
@@ -104,11 +109,11 @@ class MultiaddrRestApi {
const entities = apiHelper.parseEntitiesParams(req.body)
const result = await walletService.getWalletInfo(
- entities.active,
- entities.legacy,
- entities.bip49,
- entities.bip84,
- entities.pubkey
+ entities.active,
+ entities.legacy,
+ entities.bip49,
+ entities.bip84,
+ entities.pubkey
)
HttpServer.sendOkDataOnly(res, result)
@@ -119,7 +124,7 @@ class MultiaddrRestApi {
} finally {
if (debugApi) {
const strParams =
- `${req.body.active ? req.body.active : ''} \
+ `${req.body.active ? req.body.active : ''} \
${req.body.new ? req.body.new : ''} \
${req.body.pubkey ? req.body.pubkey : ''} \
${req.body.bip49 ? req.body.bip49 : ''} \
diff --git a/accounts/notifications-server.js b/accounts/notifications-server.js
index 1926677..5fd17ec 100644
--- a/accounts/notifications-server.js
+++ b/accounts/notifications-server.js
@@ -5,7 +5,7 @@
'use strict'
const _ = require('lodash')
-const zmq = require('zeromq')
+const zmq = require('zeromq/v5-compat')
const WebSocket = require('websocket')
const Logger = require('../lib/logger')
const network = require('../lib/bitcoin/network')
@@ -27,9 +27,6 @@ class NotificationsServer {
this.httpServer = null
// Notifications service
this.notifService = null
- // Initialize the zmq socket for communications
- // with the tracker
- this._initTrackerSocket()
}
/**
@@ -40,8 +37,12 @@ class NotificationsServer {
this.httpServer = httpServer
if (this.notifService !== null) return
-
+
this.notifService = new NotificationsService(httpServer.server)
+
+ // Initialize the zmq socket for communications
+ // with the tracker
+ this._initTrackerSocket()
}
@@ -54,7 +55,7 @@ class NotificationsServer {
this.sock.subscribe('block')
this.sock.subscribe('transaction')
- this.sock.on('message', (topic, message, sequence) => {
+ this.sock.on('message', (topic, message) => {
switch(topic.toString()) {
case 'block':
try {
diff --git a/accounts/notifications-service.js b/accounts/notifications-service.js
index 254ca49..8ac5969 100644
--- a/accounts/notifications-service.js
+++ b/accounts/notifications-service.js
@@ -14,7 +14,7 @@ const apiHelper = require('./api-helper')
const status = require('./status')
const authMgr = require('../lib/auth/authorizations-manager')
-const debug = !!(process.argv.indexOf('ws-debug') > -1)
+const debug = process.argv.indexOf('ws-debug') > -1
/**
@@ -38,7 +38,7 @@ class NotificationsService {
// Cache registering the most recent subscriptions received
// Used to filter multiple subscriptions sent by external apps.
- this.cacheSubs = LRU({
+ this.cacheSubs = new LRU({
// Maximum number of subscriptions to store in cache
// Estimate: 1000 clients with an average of 5 subscriptions
max: 5000,
@@ -80,7 +80,7 @@ class NotificationsService {
})
conn.on('message', msg => {
- if (msg.type == 'utf8')
+ if (msg.type === 'utf8')
this._handleWSMessage(msg.utf8Data, conn)
else
this._closeWSConnection(conn, true)
@@ -229,7 +229,7 @@ class NotificationsService {
/**
* Unsubscribe from a topic
* @param {string} topic - topic
- * @param {int} cid - client id
+ * @param {number} cid - client id
*/
_unsub(topic, cid) {
if (!this.subs[topic])
@@ -241,7 +241,7 @@ class NotificationsService {
this.subs[topic].splice(index, 1)
- if (this.subs[topic].length == 0) {
+ if (this.subs[topic].length === 0) {
delete this.subs[topic]
if (this.cachePubKeys.hasOwnProperty(topic))
delete this.cachePubKeys[topic]
@@ -391,7 +391,7 @@ class NotificationsService {
for (let cid of this.subs[topic]) {
if (!clients[cid])
clients[cid] = []
- if (clients[cid].indexOf(topic) == -1)
+ if (clients[cid].indexOf(topic) === -1)
clients[cid].push(topic)
}
}
@@ -429,7 +429,7 @@ class NotificationsService {
}
// Move on if the custom transaction has no inputs or outputs
- if (ctx.inputs.length == 0 && ctx.out.length == 0)
+ if (ctx.inputs.length === 0 && ctx.out.length === 0)
continue
// Send custom transaction to client
@@ -454,7 +454,7 @@ class NotificationsService {
/**
* Dispatch notification for an authentication error
* @param {string} err - error
- * @param {integer} cid - connection id
+ * @param {number} cid - connection id
*/
notifyAuthError(err, cid) {
const data = {
diff --git a/accounts/status-rest-api.js b/accounts/status-rest-api.js
index b97ad1b..5e5fbbe 100644
--- a/accounts/status-rest-api.js
+++ b/accounts/status-rest-api.js
@@ -11,7 +11,7 @@ const authMgr = require('../lib/auth/authorizations-manager')
const HttpServer = require('../lib/http-server/http-server')
const status = require('./status')
-const debugApi = !!(process.argv.indexOf('api-debug') > -1)
+const debugApi = process.argv.indexOf('api-debug') > -1
/**
diff --git a/accounts/status.js b/accounts/status.js
index f07e0b0..93d4123 100644
--- a/accounts/status.js
+++ b/accounts/status.js
@@ -29,7 +29,7 @@ class Status {
/**
* Get current status
- * @returns {Promise - object} status object
+ * @returns {Promise