Bail early in processing transactions in blocks only mode.
Previously unsolicited transactions would be processed as normal.
This commit is contained in:
parent
3587f6a024
commit
d8aaa51bec
1 changed files with 8 additions and 0 deletions
|
@ -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…
Reference in a new issue