From 494f539f4ea98417168f8d9b9f4c89931b327262 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Fri, 19 Sep 2014 17:13:01 -0700 Subject: [PATCH] feeble attempt to wrap bitcoind functions. --- binding.gyp | 16 ++++++++++++++++ src/bitcoindjs.cc | 12 ++++++++++++ 2 files changed, 28 insertions(+) diff --git a/binding.gyp b/binding.gyp index 9b416ecf..5e40a32c 100644 --- a/binding.gyp +++ b/binding.gyp @@ -42,6 +42,22 @@ '-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 e6bbd98f..46e45dfe 100644 --- a/src/bitcoindjs.cc +++ b/src/bitcoindjs.cc @@ -182,6 +182,18 @@ init(Handle); static volatile bool shutdownComplete = false; +// 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 */