aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2015-11-06 01:32:04 +0100
committerPieter Wuille <pieter.wuille@gmail.com>2016-06-22 15:42:59 +0200
commit7030d9eb47254499bba14f1c00abc6bf493efd91 (patch)
tree95055978907c7418c1b96728ff09413781b9c0b7 /src/net.h
parentecacfd98e657c5819a1bcb1da93b25d3ad4e5045 (diff)
downloadbitcoin-7030d9eb47254499bba14f1c00abc6bf493efd91.tar.xz
BIP144: Serialization, hashes, relay (sender side)
Contains refactorings by Eric Lombrozo. Contains fixup by Nicolas Dorier. Contains cleanup of CInv::GetCommand by Alex Morcos
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index aa9b2c11a3..cb35d8c4f2 100644
--- a/src/net.h
+++ b/src/net.h
@@ -598,6 +598,23 @@ public:
}
}
+ /** Send a message containing a1, serialized with flag flag. */
+ template<typename T1>
+ void PushMessageWithFlag(int flag, const char* pszCommand, const T1& a1)
+ {
+ try
+ {
+ BeginMessage(pszCommand);
+ WithOrVersion(&ssSend, flag) << a1;
+ EndMessage(pszCommand);
+ }
+ catch (...)
+ {
+ AbortMessage();
+ throw;
+ }
+ }
+
template<typename T1, typename T2>
void PushMessage(const char* pszCommand, const T1& a1, const T2& a2)
{