Commit 8219bd66a439d14f4728e4a0195f4c017c42ab90
only increment global nonce when no id is provided
Signed-off-by: wanderer <mjbecze@gmail.com>wanderer committed on 11/26/2017, 8:04:24 PM
Parent: e1300d130bf43108644745c15e32b3573369fc84
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -67,11 +67,10 @@ | ||
67 | 67 | * @param {Integer} type - the type id for the container |
68 | 68 | * @param {Object} message - an intial [message](https://github.com/primea/js-primea-message) to send newly created actor |
69 | 69 | * @param {Object} id - the id for the actor |
70 | 70 | */ |
71 | - async createActor (type, message, id = {nonce: this.nonce, parent: null}) { | |
71 | + async createActor (type, message, id = {nonce: this.nonce++, parent: null}) { | |
72 | 72 | const encoded = encodedID(id) |
73 | - this.nonce++ | |
74 | 73 | const idHash = await this._getHashFromObj(encoded) |
75 | 74 | const state = { |
76 | 75 | nonce: 0, |
77 | 76 | caps: {}, |
Built with git-ssb-web