mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
net: Fix sent reject messages for blocks and transactions
Ever since we #5913 have been sending invalid reject messages for transactions and blocks.
This commit is contained in:
parent
dc0305d15a
commit
9fc6ed6003
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user