Browse Source

komodo message hooks

pull/4/head
jl777 8 years ago
parent
commit
fcd361184f
  1. 25
      src/komodo.h
  2. 5
      src/main.cpp

25
src/komodo.h

@ -0,0 +1,25 @@
/******************************************************************************
* Copyright © 2014-2016 The SuperNET Developers. *
* *
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at *
* the top-level directory of this distribution for the individual copyright *
* holder information and the developer policies on copyright and licensing. *
* *
* Unless otherwise agreed in a custom licensing agreement, no part of the *
* SuperNET software, including this file may be copied, modified, propagated *
* or distributed except according to the terms contained in the LICENSE file *
* *
* Removal or modification of this copyright notice is prohibited. *
* *
******************************************************************************/
#ifndef H_KOMODO_H
#define H_KOMODO_H
int32_t "C" komodo_checkmsg(char *ipaddr,uint8_t *data,int32_t datalen)
{
return(0);
}
#endif

5
src/main.cpp

@ -3,6 +3,7 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "komodo.h"
#include "main.h"
#include "sodium.h"
@ -5078,8 +5079,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
else
{
// Ignore unknown commands for extensibility
LogPrint("net", "Unknown command \"%s\" from peer=%d\n", SanitizeString(strCommand), pfrom->id);
if ( komodo_checkmsg(pfrom->addr.ToString(),vRecv.begin(),nMessageSize) < 0 )
LogPrint("net", "Unknown command \"%s\" from peer=%d\n", SanitizeString(strCommand),pfrom->id);
}

Loading…
Cancel
Save