trac-msb 0.1.2 → 0.1.4
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/msb.mjs +1 -2
- package/package.json +1 -1
- package/src/index.js +3 -0
package/msb.mjs
CHANGED
|
@@ -4,8 +4,7 @@ const opts = {
|
|
|
4
4
|
stores_directory : 'stores/',
|
|
5
5
|
store_name : typeof process !== "undefined" ? process.argv[2] : Pear.config.args[0],
|
|
6
6
|
bootstrap: '4577ebf1e84c06d48b2caa33fe54ae58be3a79cb30810129d58b725fae412e37',
|
|
7
|
-
channel: '00axtracnetworkmainsettlementbus'
|
|
8
|
-
enable_updater : true
|
|
7
|
+
channel: '00axtracnetworkmainsettlementbus'
|
|
9
8
|
};
|
|
10
9
|
|
|
11
10
|
const msb = new MainSettlementBus(opts);
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -54,6 +54,7 @@ export class MainSettlementBus extends ReadyResource {
|
|
|
54
54
|
#replicate;
|
|
55
55
|
#network;
|
|
56
56
|
#opts;
|
|
57
|
+
#signature_whitelist;
|
|
57
58
|
|
|
58
59
|
constructor(options = {}) {
|
|
59
60
|
super();
|
|
@@ -83,6 +84,7 @@ export class MainSettlementBus extends ReadyResource {
|
|
|
83
84
|
this.#enable_wallet = options.enable_wallet !== false;
|
|
84
85
|
this.#wallet = new PeerWallet(options);
|
|
85
86
|
this.#replicate = options.replicate !== false;
|
|
87
|
+
this.#signature_whitelist = options.signature_whitelist !== undefined && Array.isArray(options.signature_whitelist) ? options.signature_whitelist : [];
|
|
86
88
|
this.#opts = options;
|
|
87
89
|
}
|
|
88
90
|
|
|
@@ -155,6 +157,7 @@ export class MainSettlementBus extends ReadyResource {
|
|
|
155
157
|
async #handleApplyTxOperation(op, view, base, node, batch) {
|
|
156
158
|
const postTx = op.value;
|
|
157
159
|
if (postTx.op === OperationType.POST_TX &&
|
|
160
|
+
(this.#signature_whitelist.length === 0 || this.#signature_whitelist.includes(postTx.bs)) &&
|
|
158
161
|
null === await batch.get(op.key) &&
|
|
159
162
|
this.check.sanitizePostTx(op) &&
|
|
160
163
|
op.key === postTx.tx &&
|