Browse Source

Bail early in processing transactions in blocks only mode.

Previously unsolicited transactions would be processed as normal.
0.13
Patick Strateman 9 years ago
parent
commit
d8aaa51bec
  1. 8
      src/main.cpp

8
src/main.cpp

@ -4384,6 +4384,14 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, @@ -4384,6 +4384,14 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
else if (strCommand == "tx")
{
// Stop processing the transaction early if
// We are in blocks only mode and peer is either not whitelisted or whitelistalwaysrelay is off
if (GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY) && (!pfrom->fWhitelisted || !GetBoolArg("-whitelistalwaysrelay", DEFAULT_WHITELISTALWAYSRELAY)))
{
LogPrint("net", "peer sent transaction in violation of protocol peer=%d\n", pfrom->id);
return true;
}
vector<uint256> vWorkQueue;
vector<uint256> vEraseQueue;
CTransaction tx;

Loading…
Cancel
Save