NSPV
This commit is contained in:
@@ -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);
|
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();
|
int32_t komodo_currentheight();
|
||||||
|
|
||||||
struct nSPV_spentinfo
|
struct NSPV_spentinfo
|
||||||
{
|
{
|
||||||
uint256 txid,spenttxid;
|
uint256 txid,spenttxid;
|
||||||
int32_t vout,height,spentvin,spentheight;
|
int32_t vout,height,spentvin,spentheight;
|
||||||
};
|
};
|
||||||
void komodo_nSPV_spentinfoclear();
|
void komodo_NSPV_spentinfoclear();
|
||||||
struct nSPV_spentinfo komodo_nSPV_spentinfo(uint256 txid,int32_t vout);
|
struct NSPV_spentinfo komodo_NSPV_spentinfo(uint256 txid,int32_t vout);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -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);
|
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
|
// lookup spentinfo
|
||||||
for (i=0; i<NSPV_spends.size(); i++)
|
for (i=0; i<NSPV_spends.size(); i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7225,6 +7225,12 @@ fprintf(stderr, "recv: %s peer=%d\n", SanitizeString(strCommand).c_str(), (int32
|
|||||||
{
|
{
|
||||||
pfrom->SetRecvVersion(min(pfrom->nVersion, PROTOCOL_VERSION));
|
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.
|
// Mark this node as currently connected, so we update its timestamp later.
|
||||||
if (pfrom->fNetworkNode) {
|
if (pfrom->fNetworkNode) {
|
||||||
LOCK(cs_main);
|
LOCK(cs_main);
|
||||||
|
|||||||
Reference in New Issue
Block a user