trac-msb 0.1.40 → 0.1.43
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 +1 -1
- package/msb.mjs +2 -4
- package/package.json +1 -1
- package/src/index.js +2 -2
- package/src/network.js +4 -0
package/Whitelist/pubkeys.csv
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
2eee6ef1862918445159c06a4dbff6dc3ebfebd53a0cc63964c9aead6bc8576e
|
package/msb.mjs
CHANGED
|
@@ -3,10 +3,8 @@ import {MainSettlementBus} from './src/index.js';
|
|
|
3
3
|
const opts = {
|
|
4
4
|
stores_directory : 'stores/',
|
|
5
5
|
store_name : typeof process !== "undefined" ? process.argv[2] : Pear.config.args[0],
|
|
6
|
-
bootstrap: '
|
|
7
|
-
channel: '
|
|
8
|
-
enable_txlogs : true,
|
|
9
|
-
disable_rate_limit : false
|
|
6
|
+
bootstrap: '19a12e9bdaf1cd9ae8169fd87f3d6d63d441c046e37e2ac6c3c36bcb87c59019',
|
|
7
|
+
channel: '0000tracnetworkmainsettlementbus',
|
|
10
8
|
};
|
|
11
9
|
|
|
12
10
|
const msb = new MainSettlementBus(opts);
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -766,8 +766,8 @@ export class MainSettlementBus extends ReadyResource {
|
|
|
766
766
|
this.#swarm.joinPeer(b4a.from(address, 'hex'));
|
|
767
767
|
let cnt = 0;
|
|
768
768
|
while(false === this.#swarm.peers.has(address)){
|
|
769
|
-
if(cnt >=
|
|
770
|
-
await sleep(
|
|
769
|
+
if(cnt >= 1500) break;
|
|
770
|
+
await sleep(10);
|
|
771
771
|
cnt += 1;
|
|
772
772
|
}
|
|
773
773
|
}
|
package/src/network.js
CHANGED
|
@@ -76,6 +76,7 @@ class Network {
|
|
|
76
76
|
};
|
|
77
77
|
const sig = wallet.sign(JSON.stringify(_msg) + nonce);
|
|
78
78
|
message.send({response: _msg, sig, nonce})
|
|
79
|
+
swarm.leavePeer(connection.remotePublicKey)
|
|
79
80
|
} else if (msg === 'get_admin') {
|
|
80
81
|
const res = await msb.get(EntryType.ADMIN);
|
|
81
82
|
if (wallet.publicKey !== res.tracPublicKey) return;
|
|
@@ -98,6 +99,7 @@ class Network {
|
|
|
98
99
|
network.validator_stream = connection;
|
|
99
100
|
network.validator = msg.response.address;
|
|
100
101
|
}
|
|
102
|
+
swarm.leavePeer(connection.remotePublicKey)
|
|
101
103
|
} else if (msg.response !== undefined && msg.response.op !== undefined && msg.response.op === 'admin') {
|
|
102
104
|
const res = await msb.get(EntryType.ADMIN);
|
|
103
105
|
if (res === null || res.tracPublicKey !== msg.response.address) return;
|
|
@@ -193,6 +195,8 @@ class Network {
|
|
|
193
195
|
};
|
|
194
196
|
network.tx_pool.push({tx: parsedPreTx.tx, append_tx: append_tx});
|
|
195
197
|
}
|
|
198
|
+
|
|
199
|
+
swarm.leavePeer(connection.remotePublicKey)
|
|
196
200
|
}
|
|
197
201
|
} catch (e) {
|
|
198
202
|
console.log(e);
|