remove event-based code for now.
This commit is contained in:
parent
dcb068d3b5
commit
e88f535815
16
binding.gyp
16
binding.gyp
@ -42,22 +42,6 @@
|
|||||||
'-fexceptions',
|
'-fexceptions',
|
||||||
'-frtti',
|
'-frtti',
|
||||||
],
|
],
|
||||||
#'direct_dependent_settings': {
|
|
||||||
# 'linkflags': [
|
|
||||||
# '--wrap=AcceptBlock',
|
|
||||||
# ],
|
|
||||||
# 'ldflags': [
|
|
||||||
# '--wrap=AcceptBlock',
|
|
||||||
# ],
|
|
||||||
#},
|
|
||||||
# 'export_dependent_settings': {
|
|
||||||
# 'linkflags': [
|
|
||||||
# '--wrap=AcceptBlock',
|
|
||||||
# ],
|
|
||||||
# },
|
|
||||||
#'ldflags': [
|
|
||||||
# '--wrap=AcceptBlock',
|
|
||||||
#],
|
|
||||||
'libraries': [
|
'libraries': [
|
||||||
# standard libs:
|
# standard libs:
|
||||||
# '-L/usr/lib',
|
# '-L/usr/lib',
|
||||||
|
|||||||
@ -177,26 +177,10 @@ async_get_block(uv_work_t *req);
|
|||||||
static void
|
static void
|
||||||
async_get_block_after(uv_work_t *req);
|
async_get_block_after(uv_work_t *req);
|
||||||
|
|
||||||
static void
|
|
||||||
poll_blocks(void);
|
|
||||||
|
|
||||||
extern "C" void
|
extern "C" void
|
||||||
init(Handle<Object>);
|
init(Handle<Object>);
|
||||||
|
|
||||||
static volatile bool shutdownComplete = false;
|
static volatile bool shutdownComplete = false;
|
||||||
static volatile CBlockIndex *lastindex = NULL;
|
|
||||||
|
|
||||||
// bool (*AcceptBlock_original)(CBlock& block, CValidationState& state, CDiskBlockPos* dbp) = &AcceptBlock;
|
|
||||||
// bool AcceptBlock(CBlock& block, CValidationState& state, CDiskBlockPos* dbp) {
|
|
||||||
// printf("AcceptBlock called\n");
|
|
||||||
// return AcceptBlock_original(block, state, dbp);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// bool __real_AcceptBlock(CBlock& block, CValidationState& state, CDiskBlockPos* dbp);
|
|
||||||
// bool __wrap_AcceptBlock(CBlock& block, CValidationState& state, CDiskBlockPos* dbp) {
|
|
||||||
// printf("AcceptBlock called\n");
|
|
||||||
// return __real_AcceptBlock(block, state, dbp);
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* async_block_data
|
* async_block_data
|
||||||
@ -389,8 +373,6 @@ start_node(void) {
|
|||||||
|
|
||||||
(boost::thread *)new boost::thread(boost::bind(&start_node_thread));
|
(boost::thread *)new boost::thread(boost::bind(&start_node_thread));
|
||||||
|
|
||||||
// (boost::thread *)new boost::thread(boost::bind(&poll_blocks));
|
|
||||||
|
|
||||||
// horrible fix for a race condition
|
// horrible fix for a race condition
|
||||||
sleep(2);
|
sleep(2);
|
||||||
signal(SIGINT, SIG_DFL);
|
signal(SIGINT, SIG_DFL);
|
||||||
@ -888,34 +870,6 @@ async_get_block_after(uv_work_t *req) {
|
|||||||
delete req;
|
delete req;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
poll_blocks(void) {
|
|
||||||
if (!lastindex) {
|
|
||||||
lastindex = chainActive.Tip();
|
|
||||||
}
|
|
||||||
CBlockIndex *pnext = chainActive.Next((const CBlockIndex *)lastindex);
|
|
||||||
CBlockIndex *pcur = pnext;
|
|
||||||
if (pnext) {
|
|
||||||
// execute callback
|
|
||||||
printf("Found block\n");
|
|
||||||
while ((pcur = chainActive.Next(pcur))) {
|
|
||||||
// execute callback
|
|
||||||
printf("Found block\n");
|
|
||||||
pnext = pcur;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (pnext) {
|
|
||||||
lastindex = pnext;
|
|
||||||
}
|
|
||||||
sleep(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Use mapBlockIndex.find
|
|
||||||
// mapBlockIndex.end
|
|
||||||
// mapBlockIndex.next?
|
|
||||||
// CBlockIndex* pblockindex = mapBlockIndex[block.nextblockhash];
|
|
||||||
// mapBlockIndex.find(block.nextblockhash);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Init
|
* Init
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user