Archive of the libbitcoin Slack #general channel.
flush_writes = true, the database will always corrupt with lock failure error. I also read the implementation of class flush_lock , and seems the failure is indeed can be triggered easily. Because flush_lock::try_lock only check the existence of the lock file without creating it, while flush_lock::lock_shared fails if it cannot create lock file immediately. Is this intentional?
I think semantic behavior is try_lock for non-blocking lock (this is what flush_lock::lock_shared does currently), and lock_shared for blocking lock.if (!(block_height >= prevout.height)) { std::cout << "IS_LOCKED block_height=" << block_height ... << "prevout.height: " << prevout.height << std::endl; } BITCOIN_ASSERT(block_height >= prevout.height);bool input::is_locked(size_t block_height, uint32_t median_time_past) const
{
if ((sequence_ & relative_locktime_disabled) != 0)
return false;
// bip68: a minimum block-height constraint over the input's age.
const auto minimum = (sequence_ & relative_locktime_mask);
const auto& prevout = previous_output_.metadata;
if ((sequence_ & relative_locktime_time_locked) != 0)
{
// Median time past must be monotonically-increasing by block.
BITCOIN_ASSERT(median_time_past >= prevout.median_time_past);
const auto age_seconds = median_time_past - prevout.median_time_past;
return age_seconds < (minimum << relative_locktime_seconds_shift);
}
std::cout << "bh: " << block_height << ", ph: " << prevout.height << std::endl;
if (!(block_height >= prevout.height)) {
std::cout << "IS_LOCKED block_height=" << block_height
<< " prevout = " << encode_base16(previous_output_.hash()) << ":"
<< previous_output_.index() << std::endl;
std::cout << "prevout.height: " << prevout.height << std::endl;
std::cout << std::endl << boost::stacktrace::stacktrace() << std::endl;
}
BITCOIN_ASSERT(block_height >= prevout.height);
const auto age_blocks = block_height - prevout.height;
return age_blocks < minimum;
}get_block_metadata method that fetches the metadata for a transaction that is in the database.[websockets]
$ ./install.sh --disable-shared --build-boost --build-zmq --prefix=/home/me/myprefixinstall.sh: https://github.com/libbitcoin/libbitcoin-server/blob/master/install.sh (not the one from the version3 branch)wget the version3 install script because version3 is stable/production
make.c:132:13: error: implicit declaration of function 'out_printf' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
out_printf( "...found %d target%s...\n", counts->targets, CXXLD test/libbitcoin-system-test /Library/Developer/CommandLineTools/usr/bin/make check-TESTS PASS: libbitcoin-system-test_runner.sh ============================================================================ Testsuite summary for libbitcoin-system 4.0.0 ============================================================================ # TOTAL: 1 # PASS: 1 # SKIP: 0 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 ============================================================================ Running 2310 test cases... Platform: Mac OS Compiler: Clang version 11.0.3 (clang-1103.0.32.62) STL : libc++ version 9000 Boost : 1.73.0 real 15m30.648s user 42m43.729s sys 3m54.655s
clang++ -v says
Apple LLVM version 10.0.0 (clang-1000.11.45.5) Target: x86_64-apple-darwin17.7.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin(edited)
bash-3.2$ clang++ -v Apple clang version 12.0.0 (clang-1200.0.31.1) Target: x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin