trac-peer 0.0.34 → 0.0.35

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "trac-peer",
3
3
  "main": "src/index.js",
4
- "version": "0.0.34",
4
+ "version": "0.0.35",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "autobase": "7.0.45",
package/src/index.js CHANGED
@@ -268,7 +268,9 @@ export class Peer extends ReadyResource {
268
268
 
269
269
  async updater(){
270
270
  while(true){
271
- await this.base.append(null);
271
+ if(this.base.writable){
272
+ await this.base.append(null);
273
+ }
272
274
  await this.sleep(10_000);
273
275
  }
274
276
  }
package/src/protocol.js CHANGED
@@ -40,7 +40,7 @@ class Protocol{
40
40
  content_hash + '-' +
41
41
  this.nonce).digest('hex');
42
42
  tx = createHash('sha256').update(tx).digest('hex');
43
- const signature = this.peer.wallet.sign(tx);
43
+ const signature = this.peer.wallet.sign(tx + this.nonce);
44
44
  this.peer.emit('tx', {
45
45
  op: 'pre-tx',
46
46
  tx: tx,