1. 22 Feb, 2014 1 commit
    • Wladimir J. van der Laan's avatar
      Don't use PRIx64 formatting derives from inttypes.h · 3618c435
      Wladimir J. van der Laan authored
      As the tinyformat-based formatting system (introduced in b77dfdc9) is
      type-safe, no special format characters are needed to specify sizes.
      
      Tinyformat can support (ignore) the C99 prefixes such as "ll" but
      chokes on MSVC's inttypes.h defines prefixes such as "I64X". So don't
      include inttypes.h and define our own for compatibility.
      
      (an alternative would be to sweep the entire codebase using sed -i to
      get rid of the size specifiers but this has less diff impact)
      3618c435
  2. 14 Feb, 2014 1 commit
    • Gavin Andresen's avatar
      Handle "conflicted" transactions properly · 64e9a19b
      Gavin Andresen authored
      Extend CMerkleTx::GetDepthInMainChain with the concept of
      a "conflicted" transaction-- a transaction generated by the wallet
      that is not in the main chain or in the mempool, and, therefore,
      will likely never be confirmed.
      
      GetDepthInMainChain() now returns -1 for conflicted transactions
      (0 for unconfirmed-but-in-the-mempool, and >1 for confirmed).
      
      This makes getbalance, getbalance '*', and listunspent all agree when there are
      mutated transactions in the wallet.
      
      Before:
       listunspent: one 49BTC output
       getbalance: 96 BTC (change counted twice)
       getbalance '*': 46 BTC (spends counted twice)
      
      After: all agree, 49 BTC available to spend.
      64e9a19b
  3. 13 Feb, 2014 1 commit
  4. 11 Feb, 2014 1 commit
  5. 10 Feb, 2014 1 commit
  6. 31 Jan, 2014 1 commit
    • Pieter Wuille's avatar
      Limit the number of orphan blocks · ee6b2861
      Pieter Wuille authored
      In case the total number of orphan blocks in memory exceeds a limit
      (currently set to 750), a random orphan block (which is not
      depended on by another orphan block) is dropped. This means it will
      need to be downloaded again, but it won't consume memory until then.
      ee6b2861
  7. 29 Jan, 2014 2 commits
  8. 28 Jan, 2014 1 commit
  9. 27 Jan, 2014 3 commits
    • Pieter Wuille's avatar
      Prepare block connection logic for headers-first. · e06a22b5
      Pieter Wuille authored
      This changes the block processing logic from "try to atomically switch
      to a new block" to a continuous "(dis)connect a block, aiming for the
      assumed best chain".
      
      This means the smallest atomic operations on the chainstate become
      individual block connections or disconnections, instead of entire
      reorganizations. It may mean that we try to reorganize to one block,
      fail, and rereorganize again to the old block. This is slower, but
      doesn't require unbounded RAM.
      
      It also means that a ConnectBlock which fails may be no longer called
      from the ProcessBlock which knows which node sent it. To deal with that,
      a mapBlockSource is kept, and invalid blocks cause asynchronous "reject"
      messages and banning (if necessary).
      e06a22b5
    • Pieter Wuille's avatar
    • Peter Todd's avatar
      Fix off-by-one errors in use of IsFinalTx() · c32ee02f
      Peter Todd authored
      Previously CreateNewBlock() didn't take into account the fact that
      IsFinalTx() without any arguments tests if the transaction is considered
      final in the *current* block, when both those functions really needed to
      know if the transaction would be final in the *next* block.
      
      Additionally the UI had a similar misunderstanding.
      
      Also adds some basic tests to check that CreateNewBlock() is in fact
      mining nLockTime-using transactions correctly.
      
      Thanks to Wladimir J. van der Laan for rebase.
      c32ee02f
  10. 23 Jan, 2014 2 commits
  11. 20 Jan, 2014 1 commit
  12. 11 Jan, 2014 1 commit
  13. 06 Jan, 2014 1 commit
  14. 19 Dec, 2013 1 commit
  15. 13 Dec, 2013 1 commit
  16. 08 Dec, 2013 1 commit
  17. 02 Dec, 2013 1 commit
    • Gregory Maxwell's avatar
      Sanitize assert usage and refuse to compile with NDEBUG. · b36e336a
      Gregory Maxwell authored
      There were quite a few places where assert() was used with side effects,
       making operation with NDEBUG non-functional.  This commit fixes all the
       cases I know about, but also adds an  #error on NDEBUG because the code
       is untested without assertions and may still have vulnerabilities if
       used without assert.
      b36e336a
  18. 30 Nov, 2013 3 commits
  19. 29 Nov, 2013 1 commit
  20. 26 Nov, 2013 2 commits
  21. 22 Nov, 2013 1 commit
  22. 15 Nov, 2013 1 commit
  23. 14 Nov, 2013 1 commit
  24. 11 Nov, 2013 2 commits
  25. 10 Nov, 2013 3 commits
  26. 04 Nov, 2013 3 commits
  27. 31 Oct, 2013 2 commits