This commit is contained in:
jl777
2019-07-02 04:10:48 -11:00
parent e7cd541cf1
commit a0990a8c06
3 changed files with 32 additions and 5 deletions

View File

@@ -1908,7 +1908,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
nLocalServices |= NODE_ADDRINDEX; nLocalServices |= NODE_ADDRINDEX;
if ( GetBoolArg("-spentindex", DEFAULT_SPENTINDEX) != 0 ) if ( GetBoolArg("-spentindex", DEFAULT_SPENTINDEX) != 0 )
nLocalServices |= NODE_SPENTINDEX; nLocalServices |= NODE_SPENTINDEX;
fprintf(stderr,"nLocalServices %llx %d, %d\n",(long long)nLocalServices,GetBoolArg("-addressindex", DEFAULT_ADDRESSINDEX),GetBoolArg("-spentindex", DEFAULT_SPENTINDEX));
// ********************************************************* Step 10: import blocks // ********************************************************* Step 10: import blocks
if (mapArgs.count("-blocknotify")) if (mapArgs.count("-blocknotify"))

View File

@@ -7046,6 +7046,21 @@ void static ProcessGetData(CNode* pfrom)
} }
} }
void komodo_nSPVreq(CNode *pfrom,std::vector<uint8_t> payload) // received a request
{
}
void komodo_nSPVresp(CNode *pfrom,std::vector<uint8_t> payload) // received a response
{
}
void komodo_nSPV(CNode *pto) // issue nSPV requests if has nServices
{
}
bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, int64_t nTimeReceived) bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, int64_t nTimeReceived)
{ {
const CChainParams& chainparams = Params(); const CChainParams& chainparams = Params();
@@ -7209,7 +7224,6 @@ fprintf(stderr, "recv: %s peer=%d\n", SanitizeString(strCommand).c_str(), (int32
} }
else if ( strCommand == "events" ) else if ( strCommand == "events" )
{ {
int32_t i;
if ( ASSETCHAINS_CCLIB != "gamescc" ) if ( ASSETCHAINS_CCLIB != "gamescc" )
{ {
Misbehaving(pfrom->GetId(), 1); Misbehaving(pfrom->GetId(), 1);
@@ -7412,10 +7426,22 @@ fprintf(stderr, "recv: %s peer=%d\n", SanitizeString(strCommand).c_str(), (int32
BOOST_FOREACH(const CAddress &addr, vAddr) BOOST_FOREACH(const CAddress &addr, vAddr)
pfrom->PushAddress(addr); pfrom->PushAddress(addr);
} }
else if (strCommand == "getnSPV")
{
std::vector<uint8_t> payload;
vRecv >> payload;
komodo_nSPVreq(pfrom,payload);
return(true);
}
else if ( KOMODO_NSPV != 0 ) else if ( KOMODO_NSPV != 0 )
{ {
// handle addressutxos, addresstxids, notarizations, ... messages if (strCommand == "nSPV")
{
std::vector<uint8_t> payload;
vRecv >> payload;
komodo_nSPVresp(pfrom,payload);
return(true);
}
fprintf(stderr,"ignore message %s\n",strCommand.c_str()); fprintf(stderr,"ignore message %s\n",strCommand.c_str());
return(true); return(true);
} }
@@ -8210,7 +8236,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
} }
if ( KOMODO_NSPV != 0 ) if ( KOMODO_NSPV != 0 )
{ {
// issue getaddressutxos, ... komodo_nSPV(pto);
return(true); return(true);
} }
BOOST_FOREACH(const CBlockReject& reject, state.rejects) BOOST_FOREACH(const CBlockReject& reject, state.rejects)

View File

@@ -458,6 +458,7 @@ void CNode::PushVersion()
LogPrint("net", "send version message: version %d, blocks=%d, us=%s, peer=%d\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString(), id); LogPrint("net", "send version message: version %d, blocks=%d, us=%s, peer=%d\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString(), id);
PushMessage("version", PROTOCOL_VERSION, nLocalServices, nTime, addrYou, addrMe, PushMessage("version", PROTOCOL_VERSION, nLocalServices, nTime, addrYou, addrMe,
nLocalHostNonce, strSubVersion, nBestHeight, true); nLocalHostNonce, strSubVersion, nBestHeight, true);
fprintf(stderr,"PUSH services.%llx\n",(long long)nLocalServices);
} }