This commit is contained in:
jl777
2019-07-02 09:37:20 -11:00
parent f9759375ea
commit c02de15ef2
3 changed files with 12 additions and 6 deletions

View File

@@ -336,13 +336,13 @@ int32_t komodo_priceget(int64_t *buf64,int32_t ind,int32_t height,int32_t numblo
uint64_t komodo_accrued_interest(int32_t *txheightp,uint32_t *locktimep,uint256 hash,int32_t n,int32_t checkheight,uint64_t checkvalue,int32_t tipheight);
int32_t komodo_currentheight();
struct nSPV_spentinfo
struct NSPV_spentinfo
{
uint256 txid,spenttxid;
int32_t vout,height,spentvin,spentheight;
};
void komodo_nSPV_spentinfoclear();
struct nSPV_spentinfo komodo_nSPV_spentinfo(uint256 txid,int32_t vout);
void komodo_NSPV_spentinfoclear();
struct NSPV_spentinfo komodo_NSPV_spentinfo(uint256 txid,int32_t vout);
#endif

View File

@@ -199,14 +199,14 @@ void komodo_nSPVresp(CNode *pfrom,std::vector<uint8_t> response) // received a r
}
}
void komodo_nSPV_spentinfoclear()
void komodo_NSPV_spentinfoclear()
{
NSPV_spends.resize(0);
}
struct nSPV_spentinfo komodo_nSPV_spentinfo(uint256 txid,int32_t vout) // just a primitive example of how to add new rpc to p2p msg
struct NSPV_spentinfo komodo_NSPV_spentinfo(uint256 txid,int32_t vout) // just a primitive example of how to add new rpc to p2p msg
{
std::vector<uint8_t> request; struct nSPV_spentinfo I; int32_t i,numsent = 0; uint32_t timestamp = (uint32_t)time(NULL);
std::vector<uint8_t> request; struct NSPV_spentinfo I; int32_t i,numsent = 0; uint32_t timestamp = (uint32_t)time(NULL);
// lookup spentinfo
for (i=0; i<NSPV_spends.size(); i++)
{

View File

@@ -7225,6 +7225,12 @@ fprintf(stderr, "recv: %s peer=%d\n", SanitizeString(strCommand).c_str(), (int32
{
pfrom->SetRecvVersion(min(pfrom->nVersion, PROTOCOL_VERSION));
if ( KOMODO_NSPV != 0 && (pfrom->nServices & NODE_NSPV) == 0 )
{
fprintf(stderr,"invalid nSPV peer.%d\n",pfrom->id);
pfrom->fDisconnect = true;
return false;
}
// Mark this node as currently connected, so we update its timestamp later.
if (pfrom->fNetworkNode) {
LOCK(cs_main);