trac-msb 0.0.19 → 0.0.20

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +6 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "trac-msb",
3
3
  "main": "src/index.js",
4
- "version": "0.0.19",
4
+ "version": "0.0.20",
5
5
  "pear": {
6
6
  "name": "trac-msb",
7
7
  "type": "terminal"
package/src/index.js CHANGED
@@ -64,6 +64,7 @@ export class MainSettlementBus extends ReadyResource {
64
64
  const op = node.value;
65
65
  const postTx = op.value;
66
66
  if (op.type === 'tx') {
67
+ console.log('wn-verified', crypto.verify(Buffer.from(postTx.tx + postTx.wn, 'utf-8'), Buffer.from(postTx.ws, 'hex'), Buffer.from(postTx.wp, 'hex')));
67
68
  if (null === await view.get(op.key) &&
68
69
  sanitizeTransaction(postTx) &&
69
70
  postTx.op === 'post-tx' &&
@@ -116,7 +117,9 @@ export class MainSettlementBus extends ReadyResource {
116
117
 
117
118
  async updater(){
118
119
  while(true){
119
- await this.base.append(null);
120
+ if(this.base.writable){
121
+ await this.base.append(null);
122
+ }
120
123
  await this.sleep(10_000);
121
124
  }
122
125
  }
@@ -152,6 +155,8 @@ export class MainSettlementBus extends ReadyResource {
152
155
 
153
156
  const parsedPreTx = JSON.parse(msg);
154
157
 
158
+ console.log('in-verified', crypto.verify(Buffer.from(parsedPreTx.tx + parsedPreTx.in, 'utf-8'), Buffer.from(parsedPreTx.is, 'hex'), Buffer.from(parsedPreTx.ipk, 'hex')))
159
+
155
160
  if (sanitizeTransaction(parsedPreTx) &&
156
161
  parsedPreTx.op === 'pre-tx' &&
157
162
  crypto.verify(Buffer.from(parsedPreTx.tx + parsedPreTx.in, 'utf-8'), Buffer.from(parsedPreTx.is, 'hex'), Buffer.from(parsedPreTx.ipk, 'hex')) &&