From e88f5358159af1a9cd5547a90b4a18798a9a2c82 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Fri, 19 Sep 2014 17:49:51 -0700 Subject: [PATCH] remove event-based code for now. --- binding.gyp | 16 ---------------- src/bitcoindjs.cc | 46 ---------------------------------------------- 2 files changed, 62 deletions(-) diff --git a/binding.gyp b/binding.gyp index 5e40a32c..9b416ecf 100644 --- a/binding.gyp +++ b/binding.gyp @@ -42,22 +42,6 @@ '-fexceptions', '-frtti', ], - #'direct_dependent_settings': { - # 'linkflags': [ - # '--wrap=AcceptBlock', - # ], - # 'ldflags': [ - # '--wrap=AcceptBlock', - # ], - #}, - # 'export_dependent_settings': { - # 'linkflags': [ - # '--wrap=AcceptBlock', - # ], - # }, - #'ldflags': [ - # '--wrap=AcceptBlock', - #], 'libraries': [ # standard libs: # '-L/usr/lib', diff --git a/src/bitcoindjs.cc b/src/bitcoindjs.cc index 9fe6de76..e6bbd98f 100644 --- a/src/bitcoindjs.cc +++ b/src/bitcoindjs.cc @@ -177,26 +177,10 @@ async_get_block(uv_work_t *req); static void async_get_block_after(uv_work_t *req); -static void -poll_blocks(void); - extern "C" void init(Handle); 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 @@ -389,8 +373,6 @@ start_node(void) { (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 sleep(2); signal(SIGINT, SIG_DFL); @@ -888,34 +870,6 @@ async_get_block_after(uv_work_t *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 */