From ac88e2eb619821ad7ae1d45d4b40be69051d3999 Mon Sep 17 00:00:00 2001 From: Suhas Daftuar Date: Thu, 30 Jan 2020 09:35:00 -0500 Subject: Add support for tx-relay via wtxid This adds a field to CNodeState that tracks whether to relay transactions with that peer via wtxid, instead of txid. As of this commit the field will always be false, but in a later commit we will add a way to negotiate turning this on via p2p messages exchanged with the peer. --- src/protocol.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/protocol.cpp') diff --git a/src/protocol.cpp b/src/protocol.cpp index 2dfe4bee7..30a0d5dd8 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -177,6 +177,8 @@ std::string CInv::GetCommand() const switch (masked) { case MSG_TX: return cmd.append(NetMsgType::TX); + // WTX is not a message type, just an inv type + case MSG_WTX: return cmd.append("wtx"); case MSG_BLOCK: return cmd.append(NetMsgType::BLOCK); case MSG_FILTERED_BLOCK: return cmd.append(NetMsgType::MERKLEBLOCK); case MSG_CMPCT_BLOCK: return cmd.append(NetMsgType::CMPCTBLOCK); -- cgit v1.2.3 From 46d78d47dea345329ba094310eec56ab00a02ddc Mon Sep 17 00:00:00 2001 From: Suhas Daftuar Date: Thu, 30 Jan 2020 10:10:50 -0500 Subject: Add p2p message "wtxidrelay" When sent to and received from a given peer, enables using wtxid's for announcing and fetching transactions with that peer. --- src/protocol.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/protocol.cpp') diff --git a/src/protocol.cpp b/src/protocol.cpp index 30a0d5dd8..ee77ca3b9 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -46,6 +46,7 @@ const char *GETCFHEADERS="getcfheaders"; const char *CFHEADERS="cfheaders"; const char *GETCFCHECKPT="getcfcheckpt"; const char *CFCHECKPT="cfcheckpt"; +const char *WTXIDRELAY="wtxidrelay"; } // namespace NetMsgType /** All known message types. Keep this in the same order as the list of @@ -83,6 +84,7 @@ const static std::string allNetMessageTypes[] = { NetMsgType::CFHEADERS, NetMsgType::GETCFCHECKPT, NetMsgType::CFCHECKPT, + NetMsgType::WTXIDRELAY, }; const static std::vector allNetMessageTypesVec(allNetMessageTypes, allNetMessageTypes+ARRAYLEN(allNetMessageTypes)); -- cgit v1.2.3