Archive of the libbitcoin Slack #general channel.
notifer method which then causes the value to be set according to the configuration.
The only drawback would be that bc::settings would not be perfectly consistent with the other settings classes. But with the current solution it's not either.#include "../math/external/crypto_scrypt.h" #include "../math/external/hmac_sha256.h" #include "../math/external/hmac_sha512.h" #include "../math/external/pkcs5_pbkdf2.h" #include "../math/external/ripemd160.h" #include "../math/external/sha1.h" #include "../math/external/sha256.h" #include "../math/external/sha512.h"
src_libbitcoin_la_CPPFLAGS = -I${srcdir}/include from the src dir, where ${srcdir} is ".". So backing up one from src/include gives src for src/math/external/*.hblock_chain has is_stale() but I would like to perform an action already when I'm N blocks from the top ...is_stale() which is actually just fine for my use-casevoid block_chain::fetch_history(const short_hash& address_hash, size_t limit,
size_t from_height, history_fetch_handler handler) const
{
if (stopped())
{
handler(error::service_stopped, {});
return;
}
// Cannot know size without reading all, so dynamically allocate.
chain::payment_record::list payments;
size_t count = 0;
// Result set is ordered most recent tx first (reverse point order in tx).
for (auto payment: database_.addresses().get(address_hash))
{
if (count++ == limit)
break;
const auto tx = database_.transactions().get(payment.link());
const auto height = tx.height();
if (height < from_height)
break;
// Copy of each payment record above so can be modified here.
payment.set_height(height);
payment.set_hash(tx.hash());
payments.push_back(payment);
}
handler(error::success, std::move(payments));
}This is the case with Core as well, they just don’t deal with it.
You would be reproducing code integrated into the devices themselves.
Bitcoin Core does have some logic to rewind the last N blocks...
blocktree children (vs blockchain child) index.
There are an unlimited number of things that could be indexed. The choice to do so implies an important scenario.
blocktree children (vs blockchain child) index.
There are an unlimited number of things that could be indexed. The choice to do so implies an important scenario.
static const int COINBASE_MATURITY = 100; https://github.com/bitcoin/bitcoin/blob/master/src/consensus/consensus.h#L19 within libbitcoin?