Commit Graph
139 Commits
Author SHA1 Message Date
Luke Dashjr 4f620dd0f0 Merge branch '0.4.x' into 0.5.x 2012-07-22 23:15:22 +00:00
Rune K. SvendsenandLuke Dashjr 63f319353c Let the comment in GetBlockValue() reflect the uncertainty about the time interval between subsidy reductions 2012-07-22 21:45:32 +00:00
Luke Dashjr fad2231f86 Merge branch '0.4.x' into 0.5.x
Conflicts:
	src/main.cpp
	src/serialize.h
2012-06-20 19:02:33 +00:00
Gavin AndresenandLuke Dashjr 3023e782bd print large orphan warning BEFORE deleting pvMsg 2012-06-20 18:55:24 +00:00
Gavin AndresenandLuke Dashjr 01473c3f40 Remove invalid dependent orphans from memory
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-20 17:53:18 +00:00
Gavin AndresenandLuke Dashjr ce1a071f6d Further DoS prevention: Verify signatures last
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-20 17:39:24 +00:00
Gavin AndresenandLuke Dashjr c3def40293 Optimize orphan transaction handling
Changes suggested by Sergio Demian Lerner to
help prevent potential DoS attacks.
2012-06-20 17:16:19 +00:00
Gavin AndresenandLuke Dashjr 0ce74bfaa5 Use std::numeric_limits<> for typesafe INT_MAX/etc
(this fixes a Mac OS X gitian build error for 0.5.x)
2012-06-14 20:38:25 +00:00
Gavin AndresenandLuke Dashjr 5cd2a640a5 Use std::numeric_limits<> for typesafe INT_MAX/etc
(this fixes a Mac OS X gitian build error for 0.5.x)
2012-06-14 19:52:31 +00:00
Philip KaufmannandLuke Dashjr 276cfd8530 Bugfix: Fix various places where Bitcoin-Qt was being shutdown improperly
(Partial/merge of upstream 9247134eab, 1a3f0da922, and 3e34352222)
2012-06-14 17:53:59 +00:00
Luke Dashjr 3b36da6d27 Merge branch '0.4.x' into 0.5.x
Conflicts:
	src/ui.cpp
	src/ui.h
	src/uibase.cpp
	src/xpm/about.xpm
2012-05-22 22:55:49 +00:00
R E BroadleyandLuke Dashjr 8a39b0d613 Correct debug.log output to show correct function the debug is coming from. 2012-05-22 22:42:13 +00:00
FordyandLuke Dashjr 58ac600b2c Update License in File Headers
I originally created a pull to replace the "COPYING" in crypter.cpp and
crypter.h, but it turned out that COPYING was actually the correct
file.
2012-05-20 20:15:41 +00:00
FordyandLuke Dashjr b2de28c740 Update License in File Headers
I originally created a pull to replace the "COPYING" in crypter.cpp and
crypter.h, but it turned out that COPYING was actually the correct
file.
2012-05-20 20:10:24 +00:00
Philip KaufmannandLuke Dashjr 334668cde4 remove 2 ugly spaces from a message string
(PARTIAL of 966ae00)
2012-05-20 19:54:14 +00:00
Jeff GarzikandLuke Dashjr 738592a002 Always check return values of TxnBegin() and TxnCommit()
PARTIAL, since d68dcf7 isn't backported (yet)
2012-05-18 00:03:32 +00:00
Pieter WuilleandLuke Dashjr c455aec699 Hopefully final fix for the stuck blockchain issue
Immediately issue a "getblocks", instead of a "getdata" (which will
trigger the relevant "inv" to be sent anyway), and only do so when
the previous set of invs led us into a known and attached part of
the block tree.
2012-05-17 23:45:49 +00:00
Luke Dashjr afff998ef0 Merge branch '0.4.x' into 0.5.x 2012-05-07 02:46:14 +00:00
Pieter WuilleandLuke Dashjr 2403bb79bc Prevent stuck download: correct solution
Pull request #948 introduced a fix for nodes stuck on a long side branch
of the main chain. The fix was non-functional however, as the additional
getdata request was created in a first step of processing, but dropped
in a second step as it was considered redundant. This commits fixes it
by sending the request directly.
2012-05-07 02:45:08 +00:00
Pieter WuilleandLuke Dashjr eb3f661add Prevent stuck block download in large reorganisations
In cases of very large reorganisations (hundreds of blocks), a situation
may appear where an 'inv' is sent as response to a 'getblocks', but the
last block mentioned in the inv is already known to the receiver node.
However, the supplying node uses a request for this last block as a
trigger to send the rest of the inv blocks. If it never comes, the block
chain download is stuck.

This commit makes the receiver node always request the last inv'ed block,
even if it is already known, to prevent this problem.
2012-05-07 02:44:45 +00:00
Luke Dashjr 5da2dce524 Merge branch '0.4.x' into 0.5.x 2012-05-06 05:35:50 +00:00
Luke Dashjr 607739befb Bugfix: %-12I64d is not valid and causes the parameter to be skipped, use %12"PRI64d" instead
Conflicts:

	src/walletdb.cpp
2012-05-06 05:27:08 +00:00
Luke Dashjr c328c684c2 Bugfix: Remove redundant duplicate transaction check 2012-05-04 19:54:24 +00:00
Luke Dashjr b2e5f797b5 Merge branch '0.4.x' into 0.5.x 2012-05-04 18:55:15 +00:00
Gavin AndresenandLuke Dashjr 6a89317f62 Check earlier for blocks with duplicate transactions. Fixes #1167 2012-05-04 18:55:05 +00:00
Gavin AndresenandLuke Dashjr ad5a4c7c47 Check earlier for blocks with duplicate transactions. Fixes #1167 2012-05-04 18:52:16 +00:00
Luke Dashjr a93ab87787 Merge branch '0.4.x' into 0.5.x
Conflicts:
	src/main.cpp
2012-04-22 10:05:43 -04:00
Pieter WuilleandLuke Dashjr dc588faf59 Fix potential deadlock
Conflict:
* cs_main in ProcessMessages() (before calling ProcessMessages)
* cs_vSend in CNode::BeginMessage
versus:
* cs_vSend in ThreadMessageHandler2 (before calling SendMessages)
* cs_main in SendMessages

Even though cs_vSend is a try_lock, if it succeeds simultaneously with
the locking of cs_main in ProcessMessages(), it could cause a deadlock.
2012-04-17 15:11:48 -04:00
Jeff GarzikandLuke Dashjr 774e9b6dbb Fix loop index var types, fixing many minor sign comparison warnings
foo.size() typically returns an unsigned integral type; make loop variables
match those types' signedness.
2012-04-17 14:57:42 -04:00
Jeff GarzikandLuke Dashjr 1175d8f6a1 AlreadyHave(): only hold lock during mapTransactions access 2012-04-17 14:40:58 -04:00
Jeff GarzikandLuke Dashjr 12570da46f Locking fix for AlreadyHave()
Access to mapTransactions[] must be guarded by cs_mapTransactions lock.
2012-04-17 13:20:29 -04:00
Luke Dashjr 79fc752b61 Merge branch '0.4.x' into 0.5.0.x
Conflicts:
	src/keystore.h
2012-04-15 21:05:54 -04:00
Wladimir J. van der LaanandLuke Dashjr 8460185dec fix warnings: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] 2012-04-15 19:43:41 -04:00
Pieter WuilleandLuke Dashjr 60f89779a3 Do not invoke anti-DoS system for invalid BIP16 transactions
Doing so would allow an attack on old nodes, which would relay a
standard transaction spending a BIP16 output in an invalid way,
until reaching a new node, which will disconnect their peer.

Reported by makomk on IRC.
2012-04-04 09:50:48 -04:00
Luke Dashjr 6085033f31 Merge branch '0.4.x' into 0.5.0.x 2012-03-26 20:06:55 -04:00
Pieter WuilleandLuke Dashjr b6751ed1b2 More debug output for failed reorganizations 2012-03-22 16:18:37 -04:00
Pieter WuilleandLuke Dashjr 8ed1f7c153 Report number of (dis)connected blocks in reorganization
Also report old and new best, and fork point.
2012-03-22 16:18:36 -04:00
Gavin AndresenandLuke Dashjr e364ad962f Use last checkpoint instead of hard-coded 140,700. Fixes #913. 2012-03-22 16:08:21 -04:00
Luke Dashjr 2ac8af4534 Merge branch '0.4.x' into 0.5.0.x
Conflicts:
	src/main.cpp
2012-03-21 13:49:00 -04:00
Luke Dashjr cdc6b8d6a6 Merge branch 'bip16_0.4.x' into 0.4.x 2012-03-21 13:30:56 -04:00
Luke Dashjr 2f2ac3fece Minimal support for validating BIP16 pay-to-script-hash transactions
Note this does NOT include accepting them in blocks (making them standard)
2012-03-20 15:34:43 -04:00
Luke Dashjr 78b9d2de40 Merge branch '0.4.x' into 0.5.0.x
Conflicts:
	contrib/Bitcoin.app/Contents/Info.plist
	doc/README
	doc/README_windows.txt
	share/setup.nsi
	src/serialize.h
2012-03-16 16:44:00 -04:00
Gavin AndresenandLuke Dashjr 27960a36de Fix issue #848 : broken mining on testnet 2012-03-16 16:40:38 -04:00
Gavin AndresenandLuke Dashjr 91aadbdacf Fix issue #848 : broken mining on testnet 2012-03-16 16:39:52 -04:00
Gavin AndresenandLuke Dashjr 4986c35d74 Code cleanup: use ECDSA_size() instead of fixed 10,000 byte sig buffer, and explicity init static var 2012-03-13 19:08:42 -04:00
Luke Dashjr 7013cc3d97 Merge branch '0.4.x' into 0.5.0.x 2012-03-03 13:59:19 -05:00
Luke Dashjr e9865a41d6 Merge remote branch 'sipa/nooverwritetx_v0.4.0' into 0.4.x 2012-03-03 12:59:09 -05:00
Pieter Wuille d7962747c4 Do not allow overwriting unspent transactions (BIP 30)
Introduce the following network rule:
 * a block is not valid if it contains a transaction whose hash
   already exists in the block chain, unless all that transaction's
   outputs were already spent before said block.

Warning: this is effectively a network rule change, with potential
risk for forking the block chain. Leaving this unfixed carries the
same risk however, for attackers that can cause a reorganisation
in part of the network.

Thanks to Russell O'Connor and Ben Reeves.
2012-03-03 18:51:18 +01:00
Gavin AndresenandLuke Dashjr 3108aed0f2 DoS fix for mapOrphanTransactions 2012-03-02 13:04:39 -05:00
Pieter WuilleandLuke Dashjr 1be5779124 ProcessBlock is sometimes called with pfrom==NULL 2012-02-27 12:58:53 -05:00