-
I think I'm doing something wrong. On my new OpenDHT network, get() is returning multiple values that were published using putSigned(). I though if a node uses putSigned(), that node owns that key-value and there should only be one value, even if it's updated by the node. get() is returning multiple values with different dht::Value::id. How can there be different values on my dht? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Using putSigned would not be enough to make the value unique and allow to edit it. To do that:
If the value ID is 0 when putSigned is called, the value will be assigned a random ID during the putSigned (set by OpenDHT on the Value at some point between putSigned() and the done callback). |
Beta Was this translation helpful? Give feedback.
Using putSigned would not be enough to make the value unique and allow to edit it.
The ValueID also has to be the same.
To do that:
id
for theValue
before the firstputSigned
, or let OpenDHT assign a random ID to theValue
, then modify/reuse the same Value for the followingputSigned
If the value ID is 0 when putSigned is called, the value will be assigned a random ID during the putSigned (set by OpenDHT on the Value at some point between putSigned() and the done callback).