This integrates `cxxbridge` into the build system, adding its generated
source files to `libzcash`. We currently need to manually specify each
Rust file containing a bridge description.
We could also generate this in the main build with `cxxbridge --header`,
but we have the source from vendoring `cxxbridge`, and this simplifies
the automake integration slightly.
These are needed by cxx so that when it builds its internal C++ glue
logic, it uses the same C++ compiler and flags as our top-level build.
In particular, this ensures that it links against the libc++ symbols.
During testing of the previous fixes, the node entered a state where it
was possible to incorrectly dereference a map entry and crashed. These
changes address the most likely locations of the failed check.
Since the wallet ecosystem may not be fully updated to handle
v5 transaction parsing at the point of NU5 activation, some
nodes may prefer to construct V4 transactions when not including
Orchard transaction components.
This change adds a CLI flag that allows node users to specify
that preference.
Call sync.h primitives "locks" and "mutexes" instead of "blocks" and "waitable
critical sections" to match current coding conventions and c++11 standard
names.
This PR does not rename the "CCriticalSection" class (though this could be done
as a followup) because it is used everywhere and would swamp the other changes
in this PR. Plain mutexes should mostly be preferred instead of recursive
mutexes in new code anyway.
-BEGIN VERIFY SCRIPT-
set -x
set -e
ren() { git grep -l $1 | xargs sed -i s/$1/$2/; }
ren CCriticalBlock UniqueLock
ren CWaitableCriticalSection Mutex
ren CConditionVariable std::condition_variable
ren cs_GenesisWait g_genesis_wait_mutex
ren condvar_GenesisWait g_genesis_wait_cv
perl -0777 -pi -e 's/.*typedef.*condition_variable.*\n\n?//g' src/sync.h
-END VERIFY SCRIPT-
(cherry picked from commit bitcoin/bitcoin@190bf62be1)
They should also work with any other mutex type which std::unique_lock
supports.
There is no change in behavior for current code that calls these macros with
CCriticalSection mutexes.
(cherry picked from commit bitcoin/bitcoin@1382913e61)
Move AnnotatedMixin closer to where it's used, and after the DEBUG_LOCKORDER
function declarations so it can call them.
(cherry picked from commit bitcoin/bitcoin@ba1f095aad)
Most logs should terminated with a '\n'. Some logs
are built up over multiple calls to logPrintf(), so
do not need a newline terminater. Comment all of
these 'continued' logs as a linter hing.
Zcash: Only the log lines we have. We also use a Rust logger that
doesn't actually support this kind of logging, but these annotations are
useful for knowing where to add potential future support.
(cherry picked from commit bitcoin/bitcoin@5c21e6c6d3)
If the user somehow manages to get into ShutdownRequested before
ThreadImport gets to ActivateBestChain() we may hang waiting on
condvar_GenesisWait forever. A simple wait_for and
ShutdownRequested resolves this case.
(cherry picked from commit bitcoin/bitcoin@1c9394ad47)
Zcash:
- Also added it to HARDENED_CXXFLAGS so we use it by default.
- We use -Werror if --enable-werror, so don't need the second part.
(cherry picked from commit bitcoin/bitcoin@4616c825a4)
Commit 1.
This code was written by @TheBlueMatt in the following branch:
* https://github.com/TheBlueMatt/bitcoin/commits/2017-08-test-10923
This commit message was written by me (@practicalswift) who also squashed
@TheBlueMatt's commits into one and tried to summarize the changes made.
Commit 2.
Remove boost include. Remove boost mentions in comments.
(cherry picked from commit bitcoin/bitcoin@7e319d6393)