Git Product home page Git Product logo

bitcoin's People

Contributors

codeshark avatar codler avatar cozz avatar dexx7 avatar dgenr8 avatar domob1812 avatar dooglus avatar eniks avatar fanquake avatar gavinandresen avatar gmaxwell avatar jonasschnelli avatar jtimon avatar kdomanski avatar laanwj avatar luke-jr avatar michagogo avatar morcos avatar muggenhor avatar non-github-bitcoin avatar paveljanik avatar petertodd avatar rebroad avatar sdaftuar avatar sdkfjlsfjlskdfjlsdjflsjf avatar sipa avatar super3 avatar thebluematt avatar theuni avatar wtogami avatar

Watchers

 avatar  avatar  avatar

bitcoin's Issues

Checkpoints::GetTotalBlocksEstimate will probably fail/produce wrong results

Checkpoints::GetTotalBlocksEstimate will probably fail/produce wrong results on 0.10 branch (commit 047a898).

  • No checkpoints - SIGSEGV accessing empty MapCheckpoints (i.e. std::map).
  • N > 1 checkpoint - result is less than expected (by 1), but this probably doesn't make much sense
  • Genesis block only - 0, but should be 1 - can probably break something

checkpoints.cpp:72-80

    int GetTotalBlocksEstimate()
    {
        if (!fEnabled)
            return 0;

        const MapCheckpoints& checkpoints = *Params().Checkpoints().mapCheckpoints;

        return checkpoints.rbegin()->first;
    }

Suggest to change checkpoints.cpp:79 from return checkpoints.rbegin()->first; to return checkpoints.rbegin()->first + 1;

Daemon crashes in InvalidChainFound if genesis block fails validity check

Daemon (0.10 branch, commit 047a898) crashes in InvalidChainFound when run with empty blockchain and genesis block is invalid (fails validity check).

GDB stacktrace:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
CBlockIndex::GetBlockHash (this=0x0) at chain.h:215
215         return *phashBlock;
(gdb) bt
#0  CBlockIndex::GetBlockHash (this=0x0) at chain.h:215
#1  0x0000000100157816 in InvalidChainFound (pindexNew=0x10160d5f0) at main.cpp:1365
#2  0x000000010018106e in InvalidBlockFound (pindex=0x10160d5f0, state=@0x7fff5fbf7a70) at main.cpp:1386
#3  0x000000010017fa12 in ConnectTip (state=@0x7fff5fbf7a70, pindexNew=0x10160d5f0, pblock=0x10085de30) at main.cpp:1989
#4  0x00000001001540d0 in ActivateBestChainStep (state=@0x7fff5fbf7a70, pindexMostWork=0x10160d5f0, pblock=0x10085de30) at main.cpp:2117
#5  0x0000000100152a18 in ActivateBestChain (state=@0x7fff5fbf7a70, pblock=0x10085de30) at main.cpp:2170
#6  0x0000000100163397 in InitBlockIndex () at main.cpp:3098
#7  0x0000000100071b9f in AppInit2 (threadGroup=@0x7fff5fbff688) at init.cpp:1036
#8  0x0000000100005c40 in AppInit (argc=10, argv=0x7fff5fbff898) at bitcoind.cpp:148
#9  0x0000000100005f0a in main (argc=10, argv=0x7fff5fbff898) at bitcoind.cpp:185

main.cpp:1365:

LogPrintf("InvalidChainFound:  current best=%s  height=%d  log2_work=%.8g  date=%s\n",
      chainActive.Tip()->GetBlockHash().ToString(), chainActive.Height(), log(chainActive.Tip()->nChainWork.getdouble())/log(2.0),
      DateTimeStrFormat("%Y-%m-%d %H:%M:%S", chainActive.Tip()->GetBlockTime()));

chainActive.Tip() is NULL, possibly because we don't have an active chain/chain tip as the genesis block verification has just failed.

bitcoin-opencon thread uses 100% CPU under certain circumstances with low peer availability / number of peers / seeds

Seem to spend a lot of time in the loop of the second case ("use new nodes") of CAddrMan::Select_() (addrman.cpp) called from ThreadOpenConnections (net.cpp).
Regression was introduced in pull request bitcoin#5941 โ€“ fixed size vvNew and vvTried make us spend a lot of time selecting non-empty position (i.e. the position with peer address) when actual peer number is significantly less than ADDRMAN_NEW_BUCKET_COUNT*ADDRMAN_BUCKET_SIZE. Moreover, position selection is an expensive operation as it uses secure random number generation involving OpenSSL.
Issue bitcoin#1664 is probably related too, or at least the safe buggy behavior can be expected.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.