aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_bitcoin.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Clean up RPC tests (#1465)Ross Nicoll2018-09-191-0/+3
| | | | | | | | | | * Enable full block tests * Fix invalidblocktest * Move watch only address funding to immediately before it's used, so node 0 doesn't spend the output before it checks it later. * Fix `fundrawtransaction` tests and sanitize fee calculation at the same time * Correct resolution of chain parameters when validating tx inputs, especially from previous coinbase transactions * Set block versions on full block tests so that the generated blocks are AuxPoW compatible
* Modify chain consensus parameters to be height aware (#1396)Ross Nicoll2018-09-191-1/+1
| | | | | | | | | * Modify chain consensus parameters to be height aware * Correct implementation of simplified rewards in parameters * Correct max money * Use base block version in IsSuperMajority() instead of full version * Correct mining of blocks in AuxPoW tests * Add in missing pre-AuxPoW consensus checks
* Sync mining code from Namecore to resolve unit test failures (#1385)Ross Nicoll2018-09-191-1/+1
|
* Replace test data with Dogecoin valuesRoss Nicoll2018-09-191-5/+5
| | | | | | | | | | | | | | | | | | | Replace test data with Dogecoin equivalents in the folowing tests: * base58 * bip32 * keys * miner * pow Replace RPC and deterministic signatures in unit tests with Dogecoin values. While conventionally I'd use an alternative implementation for these, as RFC 6979 compliant signature generation isn't terribly common, and there's no reason to suspect we've modified this code, I'm going to assert that it's good enough to test that the code doesn't provide different values. Disabled Bitcoin PoW tests, but left code in place to simplify later merges. These are replaced by the Dogecoin PoW tests.
* [Trivial] Grammar and typo correctionLauda2017-01-221-1/+1
| | | | Minor corrections in src\test\* .
* Remove member variable hadNoDependencies from CTxMemPoolEntryAlex Morcos2017-01-041-3/+2
| | | | Fee estimation can just check its own mapMemPoolTxs to determine the same information. Note that now fee estimation for block processing must happen before those transactions are removed, but this shoudl be a speedup.
* Merge #9283: A few more CTransactionRef optimizationsWladimir J. van der Laan2017-01-041-1/+1
|\ | | | | | | | | | | | | 91335ba Remove unused MakeTransactionRef overloads (Pieter Wuille) 6713f0f Make FillBlock consume txn_available to avoid shared_ptr copies (Pieter Wuille) 62607d7 Convert COrphanTx to keep a CTransactionRef (Pieter Wuille) c44e4c4 Make AcceptToMemoryPool take CTransactionRef (Pieter Wuille)
| * Make AcceptToMemoryPool take CTransactionRefPieter Wuille2016-12-211-1/+1
| |
* | Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-311-1/+1
| | | | | | | | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* | Add a ForceSetArg method for testingMatt Corallo2016-12-271-3/+1
| |
* | Un-expose mapArgs from utils.hMatt Corallo2016-12-241-0/+2
|/
* Merge #8895: Better SigCache ImplementationPieter Wuille2016-12-141-0/+2
|\ | | | | | | | | 67dac4e Add unit tests for the CuckooCache (Jeremy Rubin) c9e69fb Add CuckooCache implementation and replace the sigcache map_type with it (Jeremy Rubin)
| * Add CuckooCache implementation and replace the sigcache map_type with itJeremy Rubin2016-12-141-0/+2
| | | | | | | | | | | | | | | | SQUASHME: Change cuckoocache to only work for powers of two, to avoid mod operator SQUASHME: Update Documentation and simplify logarithm logic SQUASHME: OSX Build Errors SQUASHME: minor Feedback from sipa + bluematt SQUASHME: DOCONLY: Clarify a few comments.
* | Remove unused CDiskBlockPos* argument from ProcessNewBlockMatt Corallo2016-12-041-1/+1
| |
* | Switch pblock in ProcessNewBlock to a shared_ptrMatt Corallo2016-12-041-1/+2
| | | | | | | | | | This (finally) fixes a performance regression in b3b3c2a5623d5c942d2b3565cc2d833c65105555
* | Rename the remaining main.{h,cpp} to validation.{h,cpp}Matt Corallo2016-12-021-1/+1
| |
* | Move network-msg-processing code out of main to its own fileMatt Corallo2016-12-021-0/+1
| |
* | Introduce convenience type CTransactionRefPieter Wuille2016-11-191-1/+1
| |
* | Make CBlock::vtx a vector of shared_ptr<CTransaction>Pieter Wuille2016-11-191-4/+4
| |
* | Replace CValidationState param in ProcessNewBlock with BlockCheckedMatt Corallo2016-11-091-2/+1
| |
* | Remove pfrom parameter from ProcessNewBlockMatt Corallo2016-11-091-1/+1
| | | | | | | | This further decouples ProcessNewBlock from networking/peer logic.
* | Fix compact block handling to not ban if block is invalidSuhas Daftuar2016-11-031-1/+1
|/
* Merge #8865: Decouple peer-processing-logic from block-connection-logicWladimir J. van der Laan2016-10-181-1/+1
|\ | | | | | | | | | | | | | | | | | | | | a9aec5c Use BlockChecked signal to send reject messages from mapBlockSource (Matt Corallo) 7565e03 Remove SyncWithWallets wrapper function (Matt Corallo) 12ee1fe Always call UpdatedBlockTip, even if blocks were only disconnected (Matt Corallo) f5efa28 Remove CConnman parameter from ProcessNewBlock/ActivateBestChain (Matt Corallo) fef1010 Use CValidationInterface from chain logic to notify peer logic (Matt Corallo) aefcb7b Move net-processing logic definitions together in main.h (Matt Corallo) 0278fb5 Remove duplicate nBlocksEstimate cmp (we already checked IsIBD()) (Matt Corallo) 87e7d72 Make validationinterface.UpdatedBlockTip more verbose (Matt Corallo)
| * Remove CConnman parameter from ProcessNewBlock/ActivateBestChainMatt Corallo2016-10-041-1/+1
| |
* | Merge #8223: [c++11] Use std::unique_ptr for block creation.Wladimir J. van der Laan2016-10-181-2/+3
|\ \ | | | | | | | | | 9fce062 [c++11] Use std::unique_ptr for block creation. (Daniel Kraft)
| * | [c++11] Use std::unique_ptr for block creation.Daniel Kraft2016-06-181-2/+3
| | | | | | | | | | | | | | | | | | CreateNewBlock returns a pointer for which the caller takes ownership. Use std::unique_ptr to make this explicit and simplify handling of these objects in getblocktemplate.
* | | Kill insecure_random and associated global stateWladimir J. van der Laan2016-10-171-0/+1
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are only a few uses of `insecure_random` outside the tests. This PR replaces uses of insecure_random (and its accompanying global state) in the core code with an FastRandomContext that is automatically seeded on creation. This is meant to be used for inner loops. The FastRandomContext can be in the outer scope, or the class itself, then rand32() is used inside the loop. Useful e.g. for pushing addresses in CNode or the fee rounding, or randomization for coin selection. As a context is created per purpose, thus it gets rid of cross-thread unprotected shared usage of a single set of globals, this should also get rid of the potential race conditions. - I'd say TxMempool::check is not called enough to warrant using a special fast random context, this is switched to GetRand() (open for discussion...) - The use of `insecure_rand` in ConnectThroughProxy has been replaced by an atomic integer counter. The only goal here is to have a different credentials pair for each connection to go on a different Tor circuit, it does not need to be random nor unpredictable. - To avoid having a FastRandomContext on every CNode, the context is passed into PushAddress as appropriate. There remains an insecure_random for test usage in `test_random.h`.
* | Move static global randomizer seeds into CConnmanPieter Wuille2016-09-191-1/+1
| |
* | net: Pass CConnman around as neededCory Fields2016-09-081-1/+1
| |
* | net: Create CConnman to encapsulate p2p connectionsCory Fields2016-09-081-0/+6
| |
* | Use a signal to continue init after genesis activationPieter Wuille2016-07-301-0/+5
| |
* | BIP141: Other consensus critical limits, and BIP145Pieter Wuille2016-06-221-1/+1
| | | | | | | | Includes changes by Suhas Daftuar, Luke-jr, and mruddy.
* | Merge #8068: Compact BlocksWladimir J. van der Laan2016-06-221-1/+5
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 48efec8 Fix some minor compact block issues that came up in review (Matt Corallo) ccd06b9 Elaborate bucket size math (Pieter Wuille) 0d4cb48 Use vTxHashes to optimize InitData significantly (Matt Corallo) 8119026 Provide a flat list of txid/terators to txn in CTxMemPool (Matt Corallo) 678ee97 Add BIP 152 to implemented BIPs list (Matt Corallo) 56ba516 Add reconstruction debug logging (Matt Corallo) 2f34a2e Get our "best three" peers to announce blocks using cmpctblocks (Matt Corallo) 927f8ee Add ability to fetch CNode by NodeId (Matt Corallo) d25cd3e Add receiver-side protocol implementation for CMPCTBLOCK stuff (Matt Corallo) 9c837d5 Add sender-side protocol implementation for CMPCTBLOCK stuff (Matt Corallo) 00c4078 Add protocol messages for short-ids blocks (Matt Corallo) e3b2222 Add some blockencodings tests (Matt Corallo) f4f8f14 Add TestMemPoolEntryHelper::FromTx version for CTransaction (Matt Corallo) 85ad31e Add partial-block block encodings API (Matt Corallo) 5249dac Add COMPACTSIZE wrapper similar to VARINT for serialization (Matt Corallo) cbda71c Move context-required checks from CheckBlockHeader to Contextual... (Matt Corallo) 7c29ec9 If AcceptBlockHeader returns true, pindex will be set. (Matt Corallo) 96806c3 Stop trimming when mapTx is empty (Pieter Wuille)
| * | Add TestMemPoolEntryHelper::FromTx version for CTransactionMatt Corallo2016-06-191-1/+5
| |/
* / Enable mempool consistency checks in unit testsPieter Wuille2016-06-181-0/+1
|/
* Refactor CreateNewBlock to be a method of the BlockAssembler classAlex Morcos2016-05-181-1/+1
|
* Merge #7787: [Moveonly] Create ui_interface.cppWladimir J. van der Laan2016-04-191-2/+0
|\ | | | | | | | | fa10ce6 Move ui_interface.cpp to libbitcoin_server_a_SOURCES (MarcoFalke) fabbf80 [ui] Move InitError, InitWarning, AmountErrMsg (MarcoFalke)
| * [ui] Move InitError, InitWarning, AmountErrMsgMarcoFalke2016-04-021-2/+0
| |
* | test: Create test fixture for walletWladimir J. van der Laan2016-04-181-23/+0
|/ | | | | Removes all the `#ifdef ENABLE_WALLET` from `test_bitcoin` by making the wallet tests use their own fixture.
* Merge #7691: [Wallet] refactor wallet/init interactionWladimir J. van der Laan2016-04-021-1/+0
|\ | | | | | | 25340b7 [Wallet] refactor wallet/init interaction (Jonas Schnelli)
| * [Wallet] refactor wallet/init interactionJonas Schnelli2016-03-221-1/+0
| |
* | rpc: Register calls where they are definedWladimir J. van der Laan2016-03-311-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | Split out methods to every module, apart from 'help' and 'stop' which are implemented in rpcserver.cpp itself. - This makes it easier to add or remove RPC commands - no longer everything that includes rpcserver.h has to be rebuilt when there's a change there. - Cleans up `rpc/server.h` by getting rid of the huge cluttered list of function definitions. - Removes most of the bitcoin-specific code from rpcserver.cpp and .h. Continues #7307 for the non-wallet.
* | Merge #7187: Keep reorgs fast for SequenceLocks checksWladimir J. van der Laan2016-03-161-1/+1
|\ \ | |/ |/| | | 982670c Add LockPoints (Alex Morcos)
| * Add LockPointsAlex Morcos2016-03-161-1/+1
| | | | | | | | Obtain LockPoints to store in CTxMemPoolEntry and during a reorg, evaluate whether they are still valid and if not, recalculate them.
* | Move GetTempPath() to testutil.Mustafa2016-03-111-1/+2
|/
* [RPC, Wallet] Move RPC dispatch table registration to wallet/ codeJonas Schnelli2016-01-201-0/+1
| | | | Allow extending the rpc dispatch table by appending commands when server is not running.
* Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
|
* Store the total sig op count of a tx.Alex Morcos2015-12-011-1/+1
| | | | Store sum of legacy and P2SH sig op counts. This is calculated in AcceptToMemory pool and storing it saves redoing the expensive calculation in block template creation.
* Track coinbase spends in CTxMemPoolEntrySuhas Daftuar2015-11-301-1/+1
| | | | This allows us to optimize CTxMemPool::removeForReorg.
* Change GetPriority calculation.Alex Morcos2015-11-191-2/+7
| | | | Compute the value of inputs that already are in the chain at time of mempool entry and only increase priority due to aging for those inputs. This effectively changes the CTxMemPoolEntry's GetPriority calculation from an upper bound to a lower bound.