aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-12-10 11:56:51 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-12-10 11:58:02 +0100
commit5dc63ed1ca8aca62f28881ba9ef996d4036a23ea (patch)
treee365ee5c590f0090a7ea76e73e15b09b64f22aca /src
parent00b4b8d1c47a2189d085140cfb45be492de16db5 (diff)
parent20411903d7b356ebb174df2daad1dcd5d6117f79 (diff)
Merge pull request #7179
2041190 test: Add basic test for `reject` code (Wladimir J. van der Laan) 9fc6ed6 net: Fix sent reject messages for blocks and transactions (Wladimir J. van der Laan)
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a0e996ae78..84f737258c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4824,7 +4824,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
pfrom->id,
FormatStateMessage(state));
if (state.GetRejectCode() < REJECT_INTERNAL) // Never send AcceptToMemoryPool's internal codes over P2P
- pfrom->PushMessage("reject", strCommand, state.GetRejectCode(),
+ pfrom->PushMessage("reject", strCommand, (unsigned char)state.GetRejectCode(),
state.GetRejectReason().substr(0, MAX_REJECT_MESSAGE_LENGTH), inv.hash);
if (nDoS > 0)
Misbehaving(pfrom->GetId(), nDoS);
@@ -4954,7 +4954,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
int nDoS;
if (state.IsInvalid(nDoS)) {
assert (state.GetRejectCode() < REJECT_INTERNAL); // Blocks are never rejected with internal reject codes
- pfrom->PushMessage("reject", strCommand, state.GetRejectCode(),
+ pfrom->PushMessage("reject", strCommand, (unsigned char)state.GetRejectCode(),
state.GetRejectReason().substr(0, MAX_REJECT_MESSAGE_LENGTH), inv.hash);
if (nDoS > 0) {
LOCK(cs_main);