Bitcoin full node and query server

May 25, 2018

View in context in the libbitcoin Slack #general mirror.

M
Mlmikael05:16
@evoskuil @neillm 1. to traverse each transaction in new/reorged blocks, first you full_node.subscribe_blockchain() right. ( blockchain::block_chain.subscribe_blockchain() is a NOOP . safe_chain is a block_chain.) the reorganize_handler gets as incoming a block_const_ptr_list_const_ptr right, so that's a list of chain::block . this one contains a vector of transaction. this means those transaction objects are fully loaded/populated alredy here, so traversal is easy. did I get it right this far? next, what is the memory management model here, "const_ptr" here just means pointer, not refcounting by shared pointers. 2. also the transactions strucutre.. is storing transactions by reference ie pointer and not by value, no? 3. if i want to keep access to the blocks and transactions after the handler returns, should i clone all those blocks, or what's the memory management model here? I would be happy to just borrow LB's objects, however for this I need to understand the memory model as in how increase/decrease refcount or otherwise tell LB that i'm still using it / i'm done using it.