Skip to content

Commit

Permalink
debug - remove later
Browse files Browse the repository at this point in the history
  • Loading branch information
stratospher committed Feb 19, 2022
1 parent cff61c6 commit e0d021e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1848,6 +1848,7 @@ void CConnman::SocketHandlerConnected(const std::vector<CNode*>& nodes,
pnode->EnsureInitV2Key(!pnode->IsInboundConn());
EllSqPubKey peer_ellsq;
std::copy(pchBuf, pchBuf + ELLSQ_ENCODED_SIZE, peer_ellsq.data());
LogPrintf("#### Peer pubkey ellsq: %s\n", HexStr(peer_ellsq));
CPubKey v2_peer_pubkey = CPubKey(peer_ellsq);

Span<uint8_t> initiator_hdata, responder_hdata;
Expand Down Expand Up @@ -3379,6 +3380,7 @@ void CConnman::PushV2EllSqPubkey(CNode* pnode)
pnode->nSendSize += ellsq_bytes.size();
pnode->vSendMsg.push_back(ellsq_bytes);

LogPrintf("########ELLSQ KEY: %s\n", HexStr(ellsq_bytes));
// Send immediately.
nBytesSent = SocketSendData(*pnode);
}
Expand Down
7 changes: 7 additions & 0 deletions src/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,13 @@ class CNode
BIP324Keys v2_keys;
DeriveBIP324Keys(std::move(ecdh_secret), initiator_hdata, responder_hdata, v2_keys);

LogPrintf("#### ECDH Secret: %s\n", HexStr(ecdh_secret));
LogPrintf("#### initiator_F: %s\n", HexStr(v2_keys.initiator_F));
LogPrintf("#### initiator_V: %s\n", HexStr(v2_keys.initiator_V));
LogPrintf("#### responder_F: %s\n", HexStr(v2_keys.responder_F));
LogPrintf("#### responder_V: %s\n", HexStr(v2_keys.responder_V));
LogPrintf("#### session_id: %s\n", HexStr(v2_keys.session_id));

if (initiating) {
m_deserializer = std::make_unique<V2TransportDeserializer>(V2TransportDeserializer(NodeId{0}, v2_keys.responder_F, v2_keys.responder_V));
m_serializer = std::make_unique<V2TransportSerializer>(V2TransportSerializer(v2_keys.initiator_F, v2_keys.initiator_V));
Expand Down

0 comments on commit e0d021e

Please sign in to comment.