Bitcoin full node and query server

Nov 17, 2018

View in context in the libbitcoin Slack #general mirror.

jungly07:49
@pmienk, you make a good point. However, as you note, during my test development I am able to pass arguments to index, a public function, such that an block that is not yet validated is added to the confirmed index. The test passes on Ubuntu and Mac because ndebug is enabled by default. It was only with Ubuntu, clang, dynamic config on Travis that the test failed because that config had ndebug disabled. Now I am using --disable-ndebug for all my development work. I understand that maybe it is the responsibilty of data_base to not pass such bad arguments. Just wanted to raise this, because the out of box build scripts enable ndebug, as one expects. Also, in case there's some more context and history to this that will improve my understanding.
2 replies · evoskuil, jungly · last Nov 19, 2018
evoskuil13:35
As you suggest, the public database methods are the intended use exposed only through the data_base class. Sometimes we need to make methods more public than we would like to to the limitations of c++. For example in c# these methods would be limited to the module.
(edited)
jungly13:37
Yup. I also realised that to check conditions in ndebug mode we'd have to do some more processing each time. It is a hard trade off, but since database is to be used by our code, the current approach makes sense.