RFC because this is rather hackish and I’d like to know if anyone has a better idea.
I’m working on trimming out headers that libbitcoinkernel should not export. To be clear: the problem is not what headers libbitcoinkernel itself uses, but what headers it requires users to use. Basically.. the headers used directly and indirectly by bitcoin-chainstate.cpp
.
Topping the list of headers we definitely don’t want to require for users are bitcoin-config.h
and clientversion.h
. The former is somewhat complicated, but clientversion.h
only comes from one place: dbwrapper.h
.
This PR gets rid of that include by creating a new constructor that sets the version in the cpp file, working around the problem.
Another potential solution would be to create a MakeClientVersionCDataStream()
function which just creates a stream and sets the version, and relies on the caller to do the rest.
Any better ideas? Otherwise I’ll undraft and ask for review.