dht-rpc 6.11.3 → 6.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/io.js +2 -2
- package/package.json +1 -1
package/lib/io.js
CHANGED
|
@@ -13,7 +13,6 @@ const {
|
|
|
13
13
|
const VERSION = 0b11
|
|
14
14
|
const RESPONSE_ID = (0b0001 << 4) | VERSION
|
|
15
15
|
const REQUEST_ID = (0b0000 << 4) | VERSION
|
|
16
|
-
const TMP = b4a.alloc(32)
|
|
17
16
|
const EMPTY_ARRAY = []
|
|
18
17
|
|
|
19
18
|
module.exports = class IO {
|
|
@@ -498,5 +497,6 @@ function decodeReply (from, state) {
|
|
|
498
497
|
}
|
|
499
498
|
|
|
500
499
|
function validateId (id, from) {
|
|
501
|
-
|
|
500
|
+
const expected = peer.id(from.host, from.port, b4a.allocUnsafeSlow(32))
|
|
501
|
+
return b4a.equals(expected, id) ? expected : null
|
|
502
502
|
}
|