aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Only test supermajority for block rejects against v3 blocksPatrick Lodder2015-10-181-18/+4
| | | | | | | | | Since v2 and v1 blocks will be rejected at exactly the same time, only check for supermajority once to save 2000 iterations over blockheaders per block. Also moves the version check to AcceptBlockHeader() rather than AcceptBlock() to be able to reject early on.
* Use the same time-based constraints as in 1.10Patrick Lodder2015-10-181-8/+8
| | | | | | | Backport of #1225 to 1.8.x, sets: - majority window to 2000 blocks on mainnet, 1000 on testnet - enforcement triggers to 1500 on mainnet, 501 on testnet - reject triggers to 1900 on mainnet, 750 on testnet
* Reject version 1 blocks with version 3 supermajorityPatrick Lodder2015-10-181-4/+8
| | | | | | | Because CBlockIndex::IsSuperMajority was disabled since 1.5, we cannot enforce version 1 block rejection on the live chains with a v2 supermajority. Instead, we piggyback the version 3 supermajority switch to also enforce the version 2 softfork and all is good.
* enable CBlockIndex::IsSuperMajorityPatrick Lodder2015-10-181-2/+0
| | | | | | This has been disabled since 1.5 for unclear reasons, but we need it for the bip66 softfork in 1.10 that is backported here. This commit re-enables the logic.
* Implement [CBlock|CBlockIndex]::GetBaseVersion()Patrick Lodder2015-10-181-6/+6
| | | | | - nVersion & 0xff to easily compare versions without aux data - change implementations checking nVersion throughout main.ccp
* Correct BIP 66 patchesRoss Nicoll2015-10-181-20/+21
|
* Implement BIP 66 validation rules and switchover logicPieter Wuille2015-10-181-12/+27
|
* Reduce fingerprinting through timestamps in 'addr' messages.Pieter Wuille2015-06-271-5/+15
| | | | | | | Suggested by Jonas Nick. Rebased-From: 9c2737901b5203f267d21d728019d64b46f1d9f3 Github-Pull: #5860
* Introduce whitelisted peers.Pieter Wuille2015-06-271-5/+14
| | | | | | | | | | | | | | | | | | | | | | | This adds a -whitelist option to specify subnet ranges from which peers that connect are whitelisted. In addition, there is a -whitebind option which works like -bind, except peers connecting to it are also whitelisted (allowing a separate listen port for trusted connections). Being whitelisted has two effects (for now): * They are immune to DoS disconnection/banning. * Transactions they broadcast (which are valid) are always relayed, even if they were already in the mempool. This means that a node can function as a gateway for a local network, and that rebroadcasts from the local network will work as expected. Whitelisting replaces the magic exemption localhost had for DoS disconnection (local addresses are still never banned, though), which implied hidden service connects (from a localhost Tor node) were incorrectly immune to DoS disconnection as well. This old behaviour is removed for that reason, but can be restored using -whitelist=127.0.0.1 or -whitelist=::1 can be specified. -whitebind is safer to use in case non-trusted localhost connections are expected (like hidden services).
* Use pong receive time rather than processing timePieter Wuille2015-06-271-3/+3
|
* Ping automatically every 2 minutes (unconditionally)Pieter Wuille2015-06-271-7/+6
| | | | | | ... instead of after 30 minutes of no sending, for latency measurement and keep-alive. Also, disconnect if no reply arrives within 20 minutes, instead of 90 of inactivity (for peers supporting the 'pong' message).
* rename fNoListen to fListen and move to netPhilip Kaufmann2015-06-271-2/+2
| | | | | - better code readability and it belongs to net - this is a prerequisite for a pull to add -listen to the GUI
* Add %i to -blocknotify and replace it by the height of the block that the ↵langerhans2014-12-201-0/+2
| | | | notification is about
* Stricter handling of orphan transactionsGavin Andresen2014-10-041-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 Conflicts: src/main.cpp
* Merge pull request #718 from michilumin/1.8.1-dev-limit-orphan-txRoss Nicoll2014-09-281-2/+3
|\ | | | | 1.8.1 dev limit orphan tx
| * Make max number of orphan blocks kept in memory a startup parameter (fixes ↵shshshsh2014-09-271-1/+1
| | | | | | | | | | | | | | | | | | | | #4253) Rebased-From: 7b45d943b29a443f1ac808c9ee4eeed6df0db9cc Conflicts: src/init.cpp src/main.h
| * Initial check in of branch for conflict resolutionmichilumin2014-09-271-1/+2
| |
* | Fix crashing bug caused by orphan(s) with duplicate prevout.hashGavin Andresen2014-09-181-0/+2
| | | | | | | | | | Rebased-From: def2fdb Rebased-By: Wladimir J. van der Laan
* | Avoid repeated lookups in mapOrphanTransactions and mapOrphanTransactionsByPrevWladimir J. van der Laan2014-09-181-10/+13
| | | | | | | | | | Rebased-From: 89d91f6 Rebased-By: Wladimir J. van der Laan <[email protected]>
* | Add a way to limit deserialized string lengthsPieter Wuille2014-08-291-6/+3
|/ | | | | | and use it for most strings being serialized. Rebased-From: 216e9a4
* Merge pull request #622 from rnicoll/1.8-dev-safemodelangerhans2014-08-241-0/+19
|\ | | | | Disable safe mode around AuxPoW switchover
| * Disable safe mode around AuxPoW switchover.Ross Nicoll2014-08-181-0/+19
| |
* | Condense retarget debug output even more.Patrick Lodder2014-08-241-4/+5
| |
* | Merge pull request #616 from patricklodder/1.8-dev-auxpow-versionlangerhans2014-08-181-2/+6
|\ \ | | | | | | check block version for aux blocks properly for version warning
| * | check block version for aux blocks properly for version warningPatrick Lodder2014-08-171-2/+6
| | | | | | | | | | | | | | | | | | | | | UpdateTip() was checking block versions against one of two possible AuxPoW versions. Added consts for version checks and IsAuxPowVersion(int nVersion) for use with UpdateTip()'s block version check.
* | | Merge pull request #613 from rnicoll/1.8-dev-coinbaselangerhans2014-08-181-2/+4
|\ \ \ | |_|/ |/| | Correct format of AuxPoW coinbase script
| * | Added further diagnostic detail in case of transaction ID clash.Ross Nicoll2014-08-161-2/+4
| |/
* / Adjust trigger conditions for safe mode to suit Dogecoin block time.Ross Nicoll2014-08-171-3/+3
|/ | | | | | | | | | | | Values for triggering safe mode are time sensitive, and have not been modified to take into account the differing block times between Bitcoin and Dogecoin. This patch changes the interval across which a fork must exist to override any other fork to 6 hours, and increases the number of blocks an invalid fork must have before it trips safe mode. This should help mitigate disruption in the 1.7/1.8 hard fork, but miners will still need to run with -disablesafemode for the preceeding and following 2-3 days to be sure.
* Apply predetermined block for testnet forkPatrick Lodder2014-08-051-6/+15
| | | | | | | | PR #589 caused a condition for testnet difficulty to not match at a couple of cases pre block 145k leading to issues with -reindex. This makes the testnet fork hard at block 157500, while retaining every case before that block.
* Merge pull request #591 from patricklodder/1.8-version-check-fixlangerhans2014-08-041-1/+2
|\ | | | | Check against the right aux block version number
| * Check against the right aux block version numberPatrick Lodder2014-08-041-1/+2
| | | | | | | | | | | | | | | | | | Previous commit 9e9babb was based on a wrong assumption, actual CBlockHeader->nVersion for auxpow blocks is CBlockHeader::CURRENT_VERSION | (AUXPOW_CHAIN_ID * BLOCK_VERSION_CHAIN_START) and not BLOCK_VERSION_AUXPOW
* | Merge pull request #589 from patricklodder/1.8-dev-testnet-retargetlangerhans2014-08-041-13/+13
|\ \ | | | | | | Break testnet difficulty reset out of never matching condition.
| * | Break testnet difficulty reset out of never matching condition.Patrick Lodder2014-08-041-13/+13
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Testnet resets difficulty if after 2 minutes no block has been found. However, this feature was implemented with the condition to only trigger on blocks where no retargeting is done. Since the introduction of DigiShield, we retarget at every block, making this condition never to be matched. This commit removes that condition. WARNING: THIS COMMIT HARDFORKS THE DOGECOIN TESTNET! The main network is not affected by this change.
* / Tidy up retargeting code and debug.log output.Patrick Lodder2014-08-041-20/+18
|/ | | | | | | | - remove unused int64_t retargetSpacing - modulate timespan in an isolated int64_t nModulatedTimespan - keep nActualTimespan intact, to retain the original value - compress debug.log output from 5 into 3 lines while retaining all information.
* Make version check in UpdateTip() consider auxpow block versionPatrick Lodder2014-08-031-1/+1
|
* extracted auxpow constsPatrick Lodder2014-08-031-3/+3
| | | | set testnet start of auxpow to block 158100
* Support auxillary proof of work.Nell Hardcastle2014-08-011-15/+122
| | | | | Rebased from 1.7.1 into 1.7.2, moved AuxPoW checks from AcceptBlock() into AcceptBlockHeader()
* Add missing LOCK(cs_main)Pieter Wuille2014-07-091-1/+4
| | | | | Rebased-By: Wladimir J. van der Laan <[email protected]> Rebased-From: 305ccaa
* Increase IsStandard() scriptSig lengthPeter Todd2014-06-291-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.
* Do not trigger a DoS ban if SCRIPT_VERIFY_NULLDUMMY failsPeter Todd2014-06-291-6/+18
|
* Add missing cs_main lock to VerifyDBWladimir J. van der Laan2014-06-291-0/+1
| | | | Fixes issue #4139.
* Remove NumBlocksOfPeersWladimir J. van der Laan2014-06-291-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.
* Create (MANDATORY|STANDARD)_SCRIPT_VERIFY_FLAGS constantsPeter Todd2014-06-291-1/+1
|
* don't send feeless transactionsJannis Froese2014-06-091-1/+1
| | | | (cherry picked from commit 9a2f7a86fca6e243db7745cb1b15b35ce1b97b2e)
* Merge pull request #549 from leofidus/1.7-rpctestsleofidus2014-06-071-2/+2
|\ | | | | Fix bash-based rpc tests
| * Make rewards in regtest mode less randomJannis Froese2014-06-021-2/+2
| | | | | | | | | | This allows sane testing. Regtest mode is primarily intended for automated testing, so this simplification makes sense
* | use standard __func__ instead of __PRETTY_FUNCTION__Philip Kaufmann2014-05-291-4/+4
| |
* | Correct indentationR E Broadley2014-05-291-44/+45
| |
* | Split AcceptBlockHeader from AcceptBlock.Pieter Wuille2014-05-291-63/+137
| | | | | | | | Also modify some connection logic to deal with non-full blocks in the index.
* | Split up CheckBlock in a block and header versionPieter Wuille2014-05-291-9/+17
| |