trac-msb 0.0.88 → 0.0.89
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/Whitelist/pubkeys.csv +2 -1
- package/package.json +1 -1
- package/src/index.js +1 -1
- package/src/network.js +5 -3
package/Whitelist/pubkeys.csv
CHANGED
|
@@ -18,4 +18,5 @@ e74ea17cc6e05f0b09588a70d8573fca63de715a763420ff7e14b68a0c1d1d14
|
|
|
18
18
|
e18e2f57285018c8521aee085fdbbb0a69cf2484a9eadd9022cc25913716427a
|
|
19
19
|
b97c37985cc087d2512a97e00c3432542a2c874fb31543ba6a0c23ea7758cf39
|
|
20
20
|
0ddf2d7b7144873a2027b784529a9f60d48d0aab859f691faf39fce338e123a2
|
|
21
|
-
73f3dd2bda6d5904570751fad19c251186e04e18acaaf5a893404addcdabd9aa
|
|
21
|
+
73f3dd2bda6d5904570751fad19c251186e04e18acaaf5a893404addcdabd9aa
|
|
22
|
+
5937e8eb2e4a428967ce2866c189fccce23ca1ac9e42ecd195ce8e047d1849b1
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -429,7 +429,7 @@ export class MainSettlementBus extends ReadyResource {
|
|
|
429
429
|
const stream = this.#dht_node.connect(b4a.from(adminEntry.tracPublicKey, 'hex'))
|
|
430
430
|
stream.on('connect', async function () {
|
|
431
431
|
await stream.send(b4a.from(JSON.stringify({ op : 'add_writer', message : message })));
|
|
432
|
-
await stream.destroy();
|
|
432
|
+
//await stream.destroy();
|
|
433
433
|
});
|
|
434
434
|
stream.on('open', function () { });
|
|
435
435
|
stream.on('close', () => { });
|
package/src/network.js
CHANGED
|
@@ -66,12 +66,14 @@ class Network {
|
|
|
66
66
|
connection.on('message', async (msg) => {
|
|
67
67
|
try{
|
|
68
68
|
msg = b4a.toString(msg, 'utf-8');
|
|
69
|
+
//console.log(msg);
|
|
69
70
|
msg = JSON.parse(msg);
|
|
71
|
+
if(null === msg) return;
|
|
70
72
|
if(msg === 'get_writer_key'){
|
|
71
73
|
await connection.send(b4a.from(JSON.stringify({op:'writer_key', key : writingKey})));
|
|
72
|
-
await connection.destroy();
|
|
74
|
+
//await connection.destroy();
|
|
73
75
|
} else if(msg.op !== undefined && msg.message !== undefined && msg.op === 'add_writer'){
|
|
74
|
-
await connection.destroy();
|
|
76
|
+
//await connection.destroy();
|
|
75
77
|
msg = msg.message;
|
|
76
78
|
const adminEntry = await msb.getSigned(EntryType.ADMIN);
|
|
77
79
|
if(null === adminEntry || (adminEntry.tracPublicKey !== wallet.publicKey)) return;
|
|
@@ -83,7 +85,7 @@ class Network {
|
|
|
83
85
|
await base.append(msg);
|
|
84
86
|
}
|
|
85
87
|
} else {
|
|
86
|
-
await connection.destroy();
|
|
88
|
+
//await connection.destroy();
|
|
87
89
|
if (base.isIndexer || !base.writable) return;
|
|
88
90
|
|
|
89
91
|
// TODO: decide if a tx rejection should be responded with
|