From: Antoniy Shumanov <antoniy@lbry.io>
To: bitcoin-dev@lists.linuxfoundation.org
Subject: [bitcoin-dev] Contribution
Date: Wed, 30 Jan 2019 16:24:21 +0200 [thread overview]
Message-ID: <CAAdU4QpePWKmDZL65Agyd9CTWHooAy8wDtgu0TF8kFZvDZ_-JQ@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1194 bytes --]
Hi, bitcoin devs. I'm working at lbry.io and we stay closely to your core,
i want to discuss what you think about a contribution like:
base_blob and/or base_uint to be derived from std::array to be enabled move
semantics, as well on uint160, uint256, COutPoint.
Another approach that bother me is acquiring / releasing recursive mutex in
a loop, snippet from minig.cpp
while (nHeight < nHeightEnd && !ShutdownRequested())
{
std::unique_ptr<CBlockTemplate>
pblocktemplate(BlockAssembler(Params()).CreateNewBlock(coinbaseScript->reserveScript));
CBlock *pblock = &pblocktemplate->block;
{
LOCK(cs_main); // <--------- acquiring
IncrementExtraNonce(pblock, chainActive.Tip(), nExtraNonce);
} // <-------- release
std::shared_ptr<const CBlock> shared_pblock =
std::make_shared<const CBlock>(*pblock);
if (!ProcessNewBlock(Params(), shared_pblock, true, nullptr)) // <----
acquiring / release again inside
}
Doing it in a loop makes things to be slow down even more, what's idea
behind?
Also consider using of atomic global variable rather than acquiring mutex
again, no?
Did you interested in contribution in these approaches?
Regards
Antoniy Shumanov
[-- Attachment #2: Type: text/html, Size: 1598 bytes --]
next reply other threads:[~2019-01-30 14:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-30 14:24 Antoniy Shumanov [this message]
2019-01-30 16:29 ` [bitcoin-dev] Contribution Marco Falke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAAdU4QpePWKmDZL65Agyd9CTWHooAy8wDtgu0TF8kFZvDZ_-JQ@mail.gmail.com \
--to=antoniy@lbry.io \
--cc=bitcoin-dev@lists.linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox