You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuweni.apache.org by to...@apache.org on 2020/10/16 06:38:32 UTC

[incubator-tuweni] branch master updated: Expose the peer hello message (#156)

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 0f21d5c  Expose the peer hello message (#156)
0f21d5c is described below

commit 0f21d5cfe6710c1dada022c6ddf2489783801449
Author: Antoine Toulme <at...@users.noreply.github.com>
AuthorDate: Thu Oct 15 23:38:23 2020 -0700

    Expose the peer hello message (#156)
---
 .../java/org/apache/tuweni/rlpx/wire/DefaultWireConnection.java    | 5 +++++
 rlpx/src/main/java/org/apache/tuweni/rlpx/wire/WireConnection.java | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/rlpx/src/main/java/org/apache/tuweni/rlpx/wire/DefaultWireConnection.java b/rlpx/src/main/java/org/apache/tuweni/rlpx/wire/DefaultWireConnection.java
index 896b8a3..e887214 100644
--- a/rlpx/src/main/java/org/apache/tuweni/rlpx/wire/DefaultWireConnection.java
+++ b/rlpx/src/main/java/org/apache/tuweni/rlpx/wire/DefaultWireConnection.java
@@ -339,4 +339,9 @@ public final class DefaultWireConnection implements WireConnection {
   public SECP256K1.PublicKey peerPublicKey() {
     return SECP256K1.PublicKey.fromBytes(peerNodeId);
   }
+
+  @Override
+  public HelloMessage getPeerHello() {
+    return peerHelloMessage;
+  }
 }
diff --git a/rlpx/src/main/java/org/apache/tuweni/rlpx/wire/WireConnection.java b/rlpx/src/main/java/org/apache/tuweni/rlpx/wire/WireConnection.java
index 84a0da2..5b407dd 100644
--- a/rlpx/src/main/java/org/apache/tuweni/rlpx/wire/WireConnection.java
+++ b/rlpx/src/main/java/org/apache/tuweni/rlpx/wire/WireConnection.java
@@ -78,4 +78,11 @@ public interface WireConnection {
   default String uri() {
     return "enode://" + peerPublicKey().toHexString() + "@" + peerHost() + ":" + peerPort();
   }
+
+  /**
+   * Peer hello message sent during the handshake.
+   *
+   * @return the hello message the remote peer sent.
+   */
+  HelloMessage getPeerHello();
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tuweni.apache.org
For additional commands, e-mail: commits-help@tuweni.apache.org