aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Store fewer orphan tx by default, add -maxorphantx optionGavin Andresen2014-09-111-1/+2
| | | | | | | | | | There is no reason to store thousands of orphan transactions; normally an orphan's parents will either be broadcast or mined reasonably quickly. This pull drops the maximum number of orphans from 10,000 down to 100, and adds a command-line option (-maxorphantx) that is just like -maxorphanblocks to override the default.
* Make max number of orphan blocks kept in memory a startup parameter (fixes ↵shshshsh2014-09-111-1/+1
| | | | | | #4253) Rebased-From: 7b45d943b29a443f1ac808c9ee4eeed6df0db9cc
* Stricter handling of orphan transactionsGavin Andresen2014-09-111-13/+50
| | | | | | | | | Prevent denial-of-service attacks by banning peers that send us invalid orphan transactions and only storing orphan transactions given to us by a peer while the peer is connected. Rebased-From: c74332c67806ed92e6e18de174671a7c30608780
* Avoid returning many "inv" orphansJeff Garzik2014-09-101-0/+5
| | | | | Rebased-From: 540ac45 Rebased-By: Wladimir J. van der Laan <[email protected]>
* Fix crashing bug caused by orphan(s) with duplicate prevout.hashGavin Andresen2014-09-101-0/+2
| | | | | Rebased-From: def2fdb Rebased-By: Wladimir J. van der Laan
* Avoid repeated lookups in mapOrphanTransactions and mapOrphanTransactionsByPrevWladimir J. van der Laan2014-09-091-10/+13
| | | | | Rebased-From: 89d91f6 Rebased-By: Wladimir J. van der Laan <[email protected]>
* Increase IsStandard() scriptSig lengthPeter Todd2014-08-181-4/+8
| | | | | | | | | | | | | | | | Removes the limits on number of pubkeys for P2SH CHECKMULTISIG outputs. Previously with the 500 byte scriptSig limit there were odd restrictions where even a 1-of-12 P2SH could be spent in a standard transaction(1), yet multisig scriptPubKey's requiring more signatures quickly ran out of scriptSig space. From a "stuff-data-in-the-blockchain" point of view not much has changed as with the prior commit now only allowing the dummy value to be null the newly allowed scriptSig space can only be used for signatures. In any case, just using more outputs is trivial and doesn't cost much. 1) See 779b519480d8c5346de6e635119c7ee772e97ec872240c45e558f582a37b4b73 Mined by BTC Guild.
* Add a way to limit deserialized string lengthsPieter Wuille2014-08-181-6/+3
| | | | | | and use it for most strings being serialized. Rebased-From: 216e9a4
* Remove NumBlocksOfPeersWladimir J. van der Laan2014-07-041-11/+0
| | | | | | | | | | | | | Generally useless information. Only updates on connect time, not after that. Peers can easily lie and the median filter is not effective in preventing that. In the past it was used for progress display in the GUI but `CheckPoints::guessVerificationProgress` provides a better way that is now used. It was too easy to mislead it. Peers do lie about it in practice, see issue #4065. From the RPC, `getpeerinfo` gives the peer raw values, which are more useful.
* Add missing LOCK(cs_main)Pieter Wuille2014-05-211-1/+4
| | | | | Rebased-By: Wladimir J. van der Laan <[email protected]> Rebased-From: 305ccaa
* Remove dummy PRIszX macros for formattingWladimir J. van der Laan2014-05-121-11/+11
| | | | | | | | | | | | Size specifiers are no longer needed now that we use typesafe tinyformat for string formatting, instead of the system's sprintf. No functional changes. This continues the work in #3735. Rebased-By: Wladimir J. van der Laan <[email protected]> Rebased-From: 783b182
* Add missing cs_main lock to VerifyDBWladimir J. van der Laan2014-05-071-0/+1
| | | | Fixes issue #4139.
* Merge pull request #4109Wladimir J. van der Laan2014-05-011-44/+45
|\ | | | | | | 6b29ccc Correct indentation (R E Broadley)
| * Correct indentationR E Broadley2014-04-301-44/+45
| |
* | use standard __func__ instead of __PRETTY_FUNCTION__Philip Kaufmann2014-04-301-4/+4
|/
* Add MESSAGE_START_SIZE from chainparams when loading blocks from external files.Simon de la Rouviere2014-04-241-2/+2
|
* Add missing AssertLockHeld in ConnectBlockWladimir J. van der Laan2014-04-231-0/+1
|
* Solve chainActive-related locking issuesWladimir J. van der Laan2014-04-181-7/+8
| | | | | | | | | | | - In wallet and GUI code LOCK cs_main as well as cs_wallet when necessary - In main.cpp SendMessages move the TRY_LOCK(cs_main) up, to encompass the call to IsInitialBlockDownload. - Make ActivateBestChain, AddToBlockIndex, IsInitialBlockDownload, InitBlockIndex acquire the cs_main lock Fixes #3997
* Add AssertLockHeld for cs_main to ChainActive-using functionsWladimir J. van der Laan2014-04-171-0/+15
| | | | | | | | | | All functions that use ChainActive but do not aquire the cs_main lock themselves, need to be called with the cs_main lock held. This commit adds assertions to all externally callable functions that use chainActive or chainMostWork. This will flag usages when built with -DDEBUG_LOCKORDER.
* Move assert(pindexNew); to above where we dereference pindexNew.Gregory Maxwell2014-04-051-1/+1
|
* Merge pull request #3842 from ditto-b/masterGavin Andresen2014-04-021-1/+6
|\ | | | | Fix for GetBlockValue() after block 13,440,000
| * Fix for GetBlockValue() after block 13,440,000ditto-b2014-03-101-1/+6
| | | | | | | | | | Forces the block reward to zero when right shift in GetBlockValue() is undefined, after 64 reward halvings (block height 13,440,000).
* | Fix `-printblocktree` outputWladimir J. van der Laan2014-03-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | PrintBlockTree output was broken starting from e010af70. Everything appears on one line. PrintWallet() added the newline after a block, but this functionality was removed and no newline was added. Seemingly, no one noticed. Add a newline after the block information to fix this.
* | minor style cleanupsPhilip Kaufmann2014-03-111-9/+9
| |
* | Merge branch 'match_relay_fee' of git://github.com/mikehearn/bitcoinGavin Andresen2014-03-111-1/+1
|\ \
| * | Make mining fee policy match relay fee policy.Mike Hearn2014-03-101-1/+1
| |/ | | | | | | | | | | This resolves a case in which a mismatch could be used to bloat up the mempool by sending transactions that pay enough fee to relay, but not to be mined, with the default policies.
* | Merge pull request #3696Wladimir J. van der Laan2014-03-111-2/+3
|\ \ | |/ |/| | | | | c4656e0 Add progress to initial display of latest block downloaded. (R E Broadley) 75b8953 Display progress of rescan. (R E Broadley)
| * Add progress to initial display of latest block downloaded.R E Broadley2014-02-191-2/+3
| |
* | Merge pull request #3514Wladimir J. van der Laan2014-03-101-27/+122
|\ \ | | | | | | | | | f59d8f0 Per-peer block download tracking and stalled download detection. (Pieter Wuille)
| * | Per-peer block download tracking and stalled download detection.Pieter Wuille2014-02-081-27/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | Keep track of which block is being requested (and to be requested) from each peer, and limit the number of blocks in-flight per peer. In addition, detect stalled downloads, and disconnect if they persist for too long. This means blocks are never requested twice, and should eliminate duplicate downloads during synchronization.
* | | Merge pull request #3694 from gavinandresen/vfspentGavin Andresen2014-02-281-4/+21
|\ \ \ | | | | | | | | Remove CWalletTx::vfSpent
| * | | Remove CWalletTx::vfSpentGavin Andresen2014-02-261-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | Use the spent outpoint multimap to figure out which wallet transaction outputs are unspent, instead of a vfSpent array that is saved to disk.
* | | | Merge pull request #3735 from laanwj/2014_02_remove_PRIx64_completelyGavin Andresen2014-02-261-7/+7
|\ \ \ \ | |/ / / |/| | | Remove PRIx64 usage completely
| * | | Get rid of C99 PRI?64 usage in source filesWladimir J. van der Laan2014-02-241-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amend to d5f1e72. It turns out that BerkelyDB was including inttypes.h indirectly, so we cannot fix this with just macros. Trivial commit: apply the following script to all .cpp and .h files: # Middle sed -i 's/"PRIx64"/x/g' "$1" sed -i 's/"PRIu64"/u/g' "$1" sed -i 's/"PRId64"/d/g' "$1" # Initial sed -i 's/PRIx64"/"x/g' "$1" sed -i 's/PRIu64"/"u/g' "$1" sed -i 's/PRId64"/"d/g' "$1" # Trailing sed -i 's/"PRIx64/x"/g' "$1" sed -i 's/"PRIu64/u"/g' "$1" sed -i 's/"PRId64/d"/g' "$1" After this commit, `git grep` for PRI.64 should turn up nothing except the defines in util.h.
* | | | Merge pull request #3305 from mikehearn/fee_dropJeff Garzik2014-02-241-1/+1
|\ \ \ \ | |/ / / |/| | | Drop fees by 10x due to the persistently higher exchange rate.
| * | | Drop fees by 10x due to the persistently higher exchange rate.Mike Hearn2013-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The last fee drop was by 5x (from 50k satoshis to 10k satoshis) in the 0.8.2 release which was about 6 months ago. The current fee is (assuming a $500 exchange rate) about 5 dollar cents. The new fee after this patch is 0.5 cents. Miners who prefer the higher fees are obviously still able to use the command line flags to override this setting. Miners who choose to create smaller blocks will select the highest-fee paying transactions anyway. This would hopefully be the last manual adjustment ever required before floating fees become normal.
* | | | Don't use PRIx64 formatting derives from inttypes.hWladimir J. van der Laan2014-02-221-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As the tinyformat-based formatting system (introduced in b77dfdc) 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)
* | | | Merge pull request #2910Wladimir J. van der Laan2014-02-201-1/+24
|\ \ \ \ | | | | | | | | | | | | | | | d8b4b49 Don't store or send side-chain blocks lower than last checkpoint. (Ashley Holman)
| * | | | Don't store or send side-chain blocks lower than last checkpoint.Ashley Holman2014-01-191-1/+24
| | | | |
* | | | | Merge pull request #3666Wladimir J. van der Laan2014-02-171-1/+1
|\ \ \ \ \ | |_|_|_|/ |/| | | | | | | | | bbfce8a fix non-standard reason string in main.cpp (Philip Kaufmann)
| * | | | fix non-standard reason string in main.cppPhilip Kaufmann2014-02-131-1/+1
| | | | |
* | | | | Merge pull request #3646Wladimir J. van der Laan2014-02-161-1/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | 5770254 Copyright header updates s/2013/2014 on files whose last git commit was done in 2014. contrib/devtools/fix-copyright-headers.py script to be able to perform this maintenance task with ease during the rest of the year, every year. Modifications to contrib/devtools/README.md to document what fix-copyright-headers.py does. (gubatron)
| * | | | | Copyright header updates s/2013/2014 on files whose last git commit was done ↵gubatron2014-02-091-1/+1
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | in 2014. contrib/devtools/fix-copyright-headers.py script to be able to perform this maintenance task with ease during the rest of the year, every year. Modifications to contrib/devtools/README.md to document what fix-copyright-headers.py does.
* | | | | Handle "conflicted" transactions properlyGavin Andresen2014-02-141-1/+9
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Add HasCanonicalPushes(), and use it in IsStandardTxPieter Wuille2014-02-111-0/+4
|/ / /
* | | Limit the number of orphan blocksPieter Wuille2014-01-311-1/+27
| | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #3592Wladimir J. van der Laan2014-01-301-43/+43
|\ \ \ | | | | | | | | | | | | | | | | c117d9e Support for error messages and a few more rejection reasons (Luke Dashjr) 14e7ffc Use standard BIP 22 rejection reasons where applicable (Luke Dashjr)
| * | | Support for error messages and a few more rejection reasonsLuke Dashjr2014-01-291-8/+8
| | | |
| * | | Use standard BIP 22 rejection reasons where applicableLuke Dashjr2014-01-291-35/+35
| | | |
* | | | Merge pull request #3370 from sipa/headersfirst3Gavin Andresen2014-01-291-220/+271
|\ \ \ \ | |/ / / |/| | | Prepare block connection logic for headers-first