Update raw prices
This commit is contained in:
@@ -88,6 +88,5 @@ void komodo_netevent(std::vector<uint8_t> payload);
|
|||||||
#define PRICES_SMOOTHWIDTH 1
|
#define PRICES_SMOOTHWIDTH 1
|
||||||
int32_t komodo_priceind(char *symbol);
|
int32_t komodo_priceind(char *symbol);
|
||||||
void komodo_pricesinit();
|
void komodo_pricesinit();
|
||||||
void komodo_pricesupdate(int32_t height,CBlock *pblock);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -2582,6 +2582,12 @@ void komodo_pricesupdate(int32_t height,CBlock *pblock)
|
|||||||
for (i=0; i<numprices; i++)
|
for (i=0; i<numprices; i++)
|
||||||
fprintf(stderr,"%u ",rawprices[i]);
|
fprintf(stderr,"%u ",rawprices[i]);
|
||||||
fprintf(stderr,"numprices.%d\n",numprices);
|
fprintf(stderr,"numprices.%d\n",numprices);
|
||||||
|
if ( PRICES[0].fp != 0 )
|
||||||
|
{
|
||||||
|
fseek(PRICES[0].fp,height * numprices * sizeof(uint32_t),SEEK_SET);
|
||||||
|
if ( fwrite(rawprices,sizeof(uint32_t),numprices,PRICES[0].fp) != numprices )
|
||||||
|
fprintf(stderr,"error writing rawprices for ht.%d\n",height);
|
||||||
|
}
|
||||||
} else fprintf(stderr,"numprices mismatch\n");
|
} else fprintf(stderr,"numprices mismatch\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ int32_t komodo_block2pubkey33(uint8_t *pubkey33,CBlock *block);
|
|||||||
//void komodo_broadcast(CBlock *pblock,int32_t limit);
|
//void komodo_broadcast(CBlock *pblock,int32_t limit);
|
||||||
bool Getscriptaddress(char *destaddr,const CScript &scriptPubKey);
|
bool Getscriptaddress(char *destaddr,const CScript &scriptPubKey);
|
||||||
void komodo_setactivation(int32_t height);
|
void komodo_setactivation(int32_t height);
|
||||||
|
void komodo_pricesupdate(int32_t height,CBlock *pblock);
|
||||||
|
|
||||||
BlockMap mapBlockIndex;
|
BlockMap mapBlockIndex;
|
||||||
CChain chainActive;
|
CChain chainActive;
|
||||||
|
|||||||
Reference in New Issue
Block a user