This is an automated email from the ASF dual-hosted git repository.
toulmean pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tuweni.git
The following commit(s) were added to refs/heads/master by this push:
new a3f1f7f modifying sendGossipMessage to return the message hash
new 6d444ca Merge pull request #3 from jrhea/returnMessageHash
a3f1f7f is described below
commit a3f1f7ffc02016122bbc6819f79e6c4a22049452
Author: jonny rhea <[email protected]>
AuthorDate: Mon Apr 8 13:50:24 2019 -0500
modifying sendGossipMessage to return the message hash
---
plumtree/src/main/java/org/apache/tuweni/plumtree/State.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/plumtree/src/main/java/org/apache/tuweni/plumtree/State.java
b/plumtree/src/main/java/org/apache/tuweni/plumtree/State.java
index bc776e0..bb71818 100644
--- a/plumtree/src/main/java/org/apache/tuweni/plumtree/State.java
+++ b/plumtree/src/main/java/org/apache/tuweni/plumtree/State.java
@@ -244,10 +244,13 @@ public final class State {
* Sends a gossip message to all peers, according to their status.
*
* @param message the message to propagate
+ * @return The associated hash of the message
*/
- public void sendGossipMessage(Bytes message) {
- MessageHandler handler =
messageHandlers.computeIfAbsent(messageHashingFunction.hash(message),
MessageHandler::new);
+ public Bytes sendGossipMessage(Bytes message) {
+ Bytes messageHash = messageHashingFunction.hash(message);
+ MessageHandler handler = messageHandlers.computeIfAbsent(messageHash,
MessageHandler::new);
handler.fullMessageReceived(null, message);
+ return messageHash;
}
void processQueue() {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]