aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-11-17ConnectBlock(): fix error() format to be unsignedPhilip Kaufmann
- I introduced the wrong format macro with my former patch (#2018), this needs to be signed not unsigned (thanks Luke-Jr)
2012-11-17ensure we use our format macros to avoid compilation warningsPhilip Kaufmann
- fixes 2 warnings I observed while compiling on Windows with MinGW
2012-11-16Print error for coinbase-pays-too-much case of ConnectBlock failingLuke Dashjr
2012-11-12don't use memset() in privacy/security relevant code partsPhilip Kaufmann
As memset() can be optimized out by a compiler it should not be used in privacy/security relevant code parts. OpenSSL provides the safe OPENSSL_cleanse() function in crypto.h, which perfectly does the job of clean and overwrite data. For details see: http://www.viva64.com/en/b/0178/ - change memset() to OPENSSL_cleanse() where appropriate - change a hard-coded number from netbase.cpp into a sizeof()
2012-11-12fix some double-spaces in stringsPhilip Kaufmann
(partial of 6b3783a9c9cc47afcf72aa0a86ea26122392efdb)
2012-11-12Fixes a race condition in CreateNewBlock.Gregory Maxwell
CreateNewBlock was reading pindexBest at the start before taking the lock so it was possible to have the the block content not match the prevheader. (Partial of faff50d129b6d4b9e6397ac989218e83a26ae692)
2012-10-09Avoid crashes at shutdown due to printf() in global destructors.Gavin Andresen
2012-10-09Send --help message to stdout i.s.o stderrWladimir J. van der Laan
This allows fun stuff such as `bitcoin --help | less`, and more easy piping to files. Looking at other tools such as bash, gcc, they all send their help text to stdout.
2012-10-09Add a backup warning to the encryptwallet RPC commandkjj2
2012-09-17Apply BIP30 checks to all blocks except the two historic violations.Gregory Maxwell
Matt pointed out some time ago that there existed a minor DOS attack where a node in its initial block download could be wedged by an overwrite attack in a fork created between checkpoints before a time where BIP30 was enforced. Now that the BIP30 timestamp is irreversibly past the check can be more aggressive and apply to all blocks except the two historic violations.
2012-09-10select(): Use precise fd presence check, rather than imprecise hSocketMax testJeff Garzik
2012-09-10Bugfix: Don't consider invalid listening socket in hSocketMaxLuke Dashjr
Fixed upstream in 8f10a2889089af1b2ac64802360494b54c8c7ff1.
2012-09-06Correct LoadWallet() return value (false -> DB_LOAD_OK)xanatos
Equivalent code. (false == 0 == DB_LOAD_OK). Fixes #1706.
2012-08-27Bump version to 0.4.8Luke Dashjr
2012-08-27Special-case the last alert for alert-key-compromised caseGavin Andresen
Hard-code a special nId=max int alert, to be broadcast if the alert key is ever compromised. It applies to all versions, never expires, cancels all previous alerts, and has a fixed message: URGENT: Alert key compromised, upgrade required Variations are not allowed (ignored), so an attacker with the private key cannot broadcast empty-message nId=max alerts.
2012-08-26Support sending to script (P2SH) addressesLuke Dashjr
Upstream partials from 9e470585b35a84fcb7f6aa41ac0216c117e2a5e1, e679ec969c8b22c676ebb10bea1038f6c8f13b33, and 922e8e2929a2e78270868385aa46f96002fbcff3.
2012-08-26Checkpoint at block 185333 (and remove a couple of intermediate checkpoints)Gavin Andresen
2012-08-26Reject block.nVersion<=1 blocks if network has upgraded to version=2Gavin Andresen
If 950 of the last 1,000 blocks are nVersion=2, reject nVersion=1 (or zero, but no bitcoin release has created block.nVersion=0) blocks -- 75 of last 100 on testnet3. This rule is being put in place now so that we don't have to go through another "express support" process to get what we really want, which is for every single new block to include the block height in the coinbase.
2012-08-26Block height in coinbase as a new block ruleGavin Andresen
"Version 2" blocks are blocks that have nVersion=2 and have the block height as the first item in their coinbase. Block-height-in-the-coinbase is strictly enforced when version=2 blocks are a supermajority in the block chain (750 of the last 1,000 blocks on main net, 51 of 100 for testnet). This does not affect old clients/miners at all, which will continue producing nVersion=1 blocks, and which will continue to be valid.
2012-08-26Add CBlock::CURRENT_VERSION and CTransaction::CURRENT_VERSION constants.Gavin Andresen
Partial of upstream dae3e10a5abe93833c57183b7c00f1db9200f46e
2012-08-22fix a compiler sign warning in OpenBlockFile()Philip Kaufmann
2012-08-12Bugfix: Correct English grammar regarding "'s"Luke Dashjr
2012-08-12Bugfix: Use standard BTC unit in commentsLuke Dashjr
2012-08-12Bugfix: Fix a variety of misspellingsLuke Dashjr
(PARTIAL: Left out anything changing debug.log)
2012-08-12Merge branch 'bugfix_CNBerr_daggy' into 0.4.xLuke Dashjr
2012-07-22Docs Tidy upfanquake
(PARTIAL cherry pick)
2012-07-22fix OpenSSL not written as proper noun in some commentsPhilip Kaufmann
2012-07-22Let the comment in GetBlockValue() reflect the uncertainty about the time ↵Rune K. Svendsen
interval between subsidy reductions
2012-07-22CBigNum: Convert negative int64 values in a more well-defined wayLuke Dashjr
Since the minimum signed integer cannot be represented as positive so long as its type is signed, and it's not well-defined what happens if you make it unsigned before negating it, we instead increment the negative integer by 1, convert it, then increment the (now positive) unsigned integer by 1 to compensate
2012-07-22Fix signed subtraction overflow in CBigNum::setint64().Ricardo M. Correia
As noticed by sipa (Pieter Wuille), this can happen when CBigNum::setint64() is called with an integer value of INT64_MIN (-2^63). When compiled with -ftrapv, the program would crash. Otherwise, it would execute an undefined operation (although in practice, usually the correct one).
2012-07-06Do not consider inbound peers for outbound network group exclusion.Gregory Maxwell
Bitcoin will not make an outbound connection to a network group (/16 for IPv4) that it is already connected to. This means that if an attacker wants good odds of capturing all a nodes outbound connections he must have hosts on a a large number of distinct groups. Previously both inbound and outbound connections were used to feed this exclusion. The use of inbound connections, which can be controlled by the attacker, actually has the potential of making sibyl attacks _easier_: An attacker can start up hosts in groups which house many honest nodes and make outbound connections to the victim to exclude big swaths of honest nodes. Because the attacker chooses to make the outbound connection he can always beat out honest nodes for the consumption of inbound slots. At _best_ the old behavior increases attacker costs by a single group (e.g. one distinct group to use to fill up all your inbound slots), but at worst it allows the attacker to select whole networks you won't connect to. This commit makes the nodes use only outbound links to exclude network groups for outbound connections. Fancier things could be done, like weaker exclusion for inbound groups... but simplicity is good and I don't believe more complexity is currently needed.
2012-07-05Fix a few typosfanquake
2012-07-05gitian-downloader: Update luke-jr's keyLuke Dashjr
2012-07-05Update my GPG keyPieter Wuille
2012-06-20print large orphan warning BEFORE deleting pvMsgGavin Andresen
2012-06-20Bump VERSION so we can differentiate between 0.4.7rc2 and 0.4.7rc3Luke Dashjr
2012-06-20Remove invalid dependent orphans from memoryGavin Andresen
Remove orphan transactions from memory once all of their parent transactions are received and they're still not valid. Thanks to Sergio Demian Lerner for suggesting this fix.
2012-06-20Further DoS prevention: Verify signatures lastGavin Andresen
Loop over all inputs doing inexpensive validity checks first, and then loop over them a second time doing expensive signature checks. This helps prevent possible CPU exhaustion attacks where an attacker tries to make a victim waste time checking signatures for invalid transactions.
2012-06-20Optimize orphan transaction handlingGavin Andresen
Changes suggested by Sergio Demian Lerner to help prevent potential DoS attacks.
2012-06-18Don't overflow integer on 32-bit machines.Ricardo M. Correia
This was causing test_bitcoin to abort on a 32-bit system likely due to -ftrapv.
2012-06-18Don't overflow signed ints in CBigNum::setint64().Ricardo M. Correia
CBigNum::setint64() does 'n <<= 8', where n is of type "long long". This leads to shifting onto and past the sign bit, which is undefined behavior in C++11 and can cause problems in the future.
2012-06-18Document how to build/run unit testsGavin Andresen
2012-06-14Include limits, not climints (using std::numeric_limits now)Gavin Andresen
2012-06-14Use std::numeric_limits<> for typesafe INT_MAX/etcGavin Andresen
(this fixes a Mac OS X gitian build error for 0.5.x)
2012-06-14Update wiki changelog at doc/release-process.txtMatt Corallo
2012-06-14Bump VERSION so we can differentiate between fixed 0.4.7rc2 and not-fixed ↵Luke Dashjr
0.4.7rc1
2012-06-12Bugfix: Move IsStandard scriptSig size check out of IsPushOnly, since BIP16 ↵Luke Dashjr
verification uses the latter too This caused clients to reject block #177618 since it has a P2SH transaction with over 200 bytes in scriptSig. (Upstream commit: e679ec969c8b22c676ebb10bea1038f6c8f13b33)
2012-06-06fix an incorrect if-clause in net.cppPhilip Kaufmann
2012-06-06Serialize access to debug.log streamMichael Hendricks
Acquire an exclusive, advisory lock before sending output to debug.log and release it when we're done. This should avoid output from multiple threads being interspersed in the log file. We can't use CRITICAL_SECTION machinery for this because the debug log is written during startup and shutdown when that machinery is not available. (Thanks to Gavin for pointing out the CRITICAL_SECTION problems based on his earlier work in this area)
2012-05-26.gitignore: add test_bitcoinJeff Garzik