From fcd361184f09fe17546698b0d13caddac5b63500 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 14 Sep 2016 05:12:12 -0300 Subject: [PATCH] komodo message hooks --- src/komodo.h | 25 +++++++++++++++++++++++++ src/main.cpp | 5 +++-- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 src/komodo.h diff --git a/src/komodo.h b/src/komodo.h new file mode 100644 index 000000000..5fbe51db7 --- /dev/null +++ b/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 diff --git a/src/main.cpp b/src/main.cpp index e3b2b5903..ccfbdfd93 100644 --- a/src/main.cpp +++ b/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); }