Skip to content

Commit

Permalink
Included PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
freimair committed Sep 1, 2020
1 parent 435cc3d commit 3542e27
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ public GetUpdatedDataRequest buildGetUpdatedDataRequest(NodeAddress senderNodeAd
/**
* Create the special key. <br><br>
*
* <ul>
* <li>A "key" is a 20 byte cryptographic hash code to identify a single p2p network message</li>
* <li>A "special key" is the label to a bundle of p2p network messages, each having standard keys</li>
* </ul>
*
* For example: "1.3.4" encoded into a 20 byte array.
*
* @return the special key
Expand All @@ -229,7 +234,11 @@ private byte[] getSpecialKey() {
}

/**
* See if the request contains a "special key".
* See if the request contains a "special key". A special key is a label of a bundle of messages.
* <ul>
* <li>A "key" is a 20 byte cryptographic hash code to identify a single p2p network message</li>
* <li>A "special key" is the label to a bundle of p2p network messages, each having standard keys</li>
* </ul>
*
* @param knownPayloadHashes
* @return the "special key" or <code>null</code> if no special key has been found
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected PersistableNetworkPayload putIfAbsent(P2PDataStorage.ByteArray hash,
if (getMap().containsKey(hash))
return null;

PersistableNetworkPayload previous = store.getMap().putIfAbsent(hash, payload);
PersistableNetworkPayload previous = store.getMap().put(hash, payload);
persist();
return previous;
}
Expand Down

0 comments on commit 3542e27

Please sign in to comment.