Commit Graph

1075 Commits

Author SHA1 Message Date
Philip Kaufmann
cae1a68267 remove obsolete BackupWallet() entry in wallet.h 2012-05-04 17:41:13 +00:00
Philip Kaufmann
4898482915 fix compiler warning "suggest parentheses around assignment used as truth
value [-Wparentheses]" in util.cpp
2012-05-01 23:11:56 -04:00
Philip Kaufmann
e6578e7fa7 remove unused typedef in serialize.h 2012-05-01 23:09:22 -04:00
Gavin Andresen
5ad4028050 Windows build: compile against openssl 1.0.1b 2012-04-27 11:19:20 -04:00
Luke Dashjr
c18b82d5db Bump version to 0.4.6 2012-04-27 10:50:24 -04:00
Timothy Redaelli
282e3ffe6e We should include netinet/in.h to use sockaddr_in (POSIX.1-2001) 2012-04-27 10:41:52 -04:00
Jeff Garzik
c21121752d CBlock::WriteToDisk() properly checks ftell(3) for error return
Rather than storing ftell(3)'s return value -- a long -- in an
unsigned int, we store and check a properly typed temp.  Then, assured a
non-negative value, we store in nBlockPosRet.
2012-04-24 01:00:15 -04:00
Timothy Redaelli
d0fe14ffec Add missing includes. (Fix bulding under GCC 4.7)
(Note: GCC 4.7 build NOT tested with backports -Luke)
2012-04-22 09:41:51 -04:00
Dwayne C. Litzenberger
e5b980d72f Fix bugs on 'unsigned char' platforms.
In ISO C++, the signedness of 'char' is undefined.  On some platforms (e.g.
ARM), 'char' is an unsigned type, but some of the code relies on 'char' being
signed (as it is on x86).  This is indicated by compiler warnings like this:

 bignum.h: In constructor 'CBigNum::CBigNum(char)':
 bignum.h:81:59: warning: comparison is always true due to limited range of data type [-Wtype-limits]

 util.cpp: In function 'bool IsHex(const string&)':
 util.cpp:427:28: warning: comparison is always false due to limited range of data type [-Wtype-limits]

In particular, IsHex erroneously returned true regardless of the input
characters, as long as the length of the string was a positive multiple of 2.

Note: For testing, it's possible using GCC to force char to be unsigned by
adding the -funsigned-char parameter to xCXXFLAGS.
2012-04-22 09:38:27 -04:00
Dwayne C. Litzenberger
bd043f19c8 Fix phexdigits[255] is undefined. 2012-04-22 09:26:11 -04:00
Pieter Wuille
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 Garzik
7f34351910 Fix misc. minor sign-comparison warnings 2012-04-17 15:08:18 -04:00
Jeff Garzik
1b7e5cbcad CNode's nHeaderStart may be negative, so change its type (PARTIAL) 2012-04-17 15:03:05 -04:00
Jeff Garzik
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 Garzik
ef2f3ddaf7 The string class returns string::npos, when find() fails.
Noticed when sign-comparison warnings were enabled.
2012-04-17 14:50:26 -04:00
Jeff Garzik
1175d8f6a1 AlreadyHave(): only hold lock during mapTransactions access 2012-04-17 14:40:58 -04:00
Jeff Garzik
12570da46f Locking fix for AlreadyHave()
Access to mapTransactions[] must be guarded by cs_mapTransactions lock.
2012-04-17 13:20:29 -04:00
Wladimir J. van der Laan
8460185dec fix warnings: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] 2012-04-15 19:43:41 -04:00
Wladimir J. van der Laan
678a319888 fix warnings: delete called on 'XX' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] 2012-04-15 19:42:19 -04:00
Wladimir J. van der Laan
f650d62fc6 fix warnings: array subscript is of type 'char' [-Wchar-subscripts] 2012-04-15 19:28:00 -04:00
Wladimir J. van der Laan
401db6d96b work around issue in boost::program_options that prevents from compiling in clang 2012-04-15 19:23:01 -04:00
Gavin Andresen
e88b6b341d Bug fix listtransactions from/count handling. 2012-04-14 15:29:43 -04:00
Pieter Wuille
c7057326ea Verify status of encrypt/decrypt calls to detect failed padding 2012-04-05 18:03:48 -04:00
Matt Corallo
bf754cfd01 Add laanwj to gitian download scripts. 2012-04-04 15:58:02 -04:00
Luke Dashjr
8fae3dae11 Add Luke-Jr's PGP key to gitian-downloader 2012-04-04 10:23:02 -04:00
Pieter Wuille
2f98e8c1a4 Updated my GPG key 2012-04-04 10:17:18 -04:00
Luke Dashjr
d53fbb4a53 Fix script tests for P2SH
Upstream: 922e8e2929
2012-04-04 10:00:32 -04:00
Vegard Nossum
d15180297f Fix testing setup
There were some problems with the existing testing setup:

 - Makefile rules for test-file compilation used CFLAGS instead of
   CXXFLAGS in makefile.unix
2012-04-04 10:00:20 -04:00
Pieter Wuille
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
Pieter Wuille
fea0a27ddc Check minversion before loading the rest of the wallet
When a 0.6 wallet with compressed pubkeys is created, it writes a
minversion record to prevent older clients from reading it. If the 0.5
loading it sees a key record before seeing the minversion record however,
it will fail with DB_CORRUPT instead of DB_TOO_NEW.
2012-03-22 16:25:36 -04:00
Alistair Buxton
04dc79f1cc When disconnecting a node, clear the received buffer so that we do
not process any already received messages.

The primary reason to do this is if a node spams hundreds of messages
and we ban them, we don't want to continue processing the rest of it.
2012-03-22 16:19:26 -04:00
Pieter Wuille
b6751ed1b2 More debug output for failed reorganizations 2012-03-22 16:18:37 -04:00
Pieter Wuille
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 Andresen
e364ad962f Use last checkpoint instead of hard-coded 140,700. Fixes #913. 2012-03-22 16:08:21 -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
Pieter Wuille
0e6c6e3fd1 Workaround for BN_bn2mpi reading/writing out of bounds
When OpenSSL's BN_bn2mpi is passed a buffer of size 4, valgrind
reports reading/writing one byte past it. I am unable to find
evidence of this behaviour in BN_bn2mpi's source code, so it may
be a spurious warning. However, this change is harmless, as only
the bignum with value 0 results in an mpi serialization of size 4.
2012-03-19 19:08:19 -04:00
Luke Dashjr
1194f00350 Print more diagnostic info for the various DB_CORRUPT conditions 2012-03-19 12:52:22 -04:00
Luke Dashjr
00d832756c Print wallet load errors (to debug.log) 2012-03-19 12:51:24 -04:00
Gavin Andresen
91aadbdacf Fix issue #848 : broken mining on testnet 2012-03-16 16:39:52 -04:00
Luke Dashjr
ffef16404d Bump version to 0.4.5 2012-03-16 16:04:26 -04:00
Gavin Andresen
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
Gregory Maxwell
11c34e0f6c Resolves issue #922 - "wallet passphrase timeout of several years doesn't work"
2^31 milliseconds is only about 25 days. Also clamps Sleep() to 10 years,
because it currently sleeps for 0 seconds when the sleep time would cross
2^31 seconds since the epoch. Hopefully boost will be fixed by 2028.
2012-03-11 21:53:47 -04:00
Luke Dashjr
88aa771536 Bugfix: Fix possible buffer overflow (#901)
Upstream commit: 21ae37d (partial)
2012-03-03 13:51:10 -05:00
Luke Dashjr
4fc8c042a2 Bugfix: Check return value of SHGetSpecialFolderPath in MyGetSpecialFolderPath
Upstream commit: 21ae37d (partial)
2012-03-03 13:45:44 -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 Andresen
3108aed0f2 DoS fix for mapOrphanTransactions 2012-03-02 13:04:39 -05:00
Gavin Andresen
feb3c15335 Checkpoint block 168,000 2012-02-27 13:00:23 -05:00
Pieter Wuille
ab2be34059 Fix #616: remove base_uint::operator&=(uint64 b) 2012-02-27 12:55:15 -05:00