Age | Commit message (Collapse) | Author |
|
This commit removes the dependency of serialize.h on PROTOCOL_VERSION,
and makes this parameter required instead of implicit. This is much saner,
as it makes the places where changing a version number can have an
influence obvious.
|
|
|
|
Fix many sign-comparison warnings found in bitcoin codebase
|
|
Sometimes they sneak in through the 'vi' door
|
|
|
|
Locking fix for AlreadyHave()
|
|
BIP 0031: pong message
|
|
foo.size() typically returns an unsigned integral type; make loop variables
match those types' signedness.
|
|
|
|
Access to mapTransactions[] must be guarded by cs_mapTransactions lock.
Also, reformat long lines to make the switch statement more readable.
|
|
Open database once per "tx" message, rather than multiple times,
in the case of orphan transaction presence.
As a side effect, a now-unused CTransaction::AcceptToMemoryPool()
variant is removed.
|
|
stored in version.h.
Also, a minor CAddress code reformat while we're in there, fixing
some incorrect indentation.
|
|
Reference miner exists for testnet-in-a-box type situations, and as a
reference. We don't care enough about highly optimized internal
mining to keep workarounds like this.
|
|
Add a pong message that is sent in reply to a ping. It echoes back a nonce
field that is now added to the ping message. Send a nonce of zero in ping
messages.
Original author: Mike Hearn @ Google
Modified Mike's change to introduce a mild form of protocol documentation in
version.h.
|
|
Where possible, use boost::filesystem::path instead of std::string or
char* for filenames. This avoids a lot of manual string tinkering, in
favor of path::operator/.
GetDataDir is also reworked significantly, it now only keeps two cached
directory names (the network-specific data dir, and the root data dir),
which are decided through a parameter instead of pre-initialized global
variables.
Finally, remove the "upgrade from 0.1.5" case where a debug.log in the
current directory has to be removed.
|
|
Build identification strings
|
|
All client version information is moved to version.cpp, which optionally
(-DHAVE_BUILD_INFO) includes build.h. build.h is automatically generated
on supporting platforms via contrib/genbuild.sh, using git describe.
The git export-subst attribute is used to put the commit id statically
in version.cpp inside generated archives, and this value is used if no
build.h is present.
The gitian descriptors are modified to use git archive instead of a
copy, to create the src/ directory in the output. This way,
src/src/version.cpp will contain the static commit id. To prevent
gitian builds from getting the "-dirty" marker in their git-describe
generated identifiers, no touching of files or running sed on the
makefile is performed anymore. This does not seem to influence
determinism.
|
|
|
|
- rename wxMessageBox, remove redundant arguments to noui/qtui calls
- also, add flag to force blocking, modal dialog box for disk space warning etc
- clarify function naming
- no more special MessageBox needed from AppInit2, as window object is created before calling AppInit2
|
|
|
|
|
|
Limit getheaders to a hard 2000.
|
|
|
|
|
|
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.
|
|
|
|
|
|
Previously getheaders would return any number of headers up to
2000 + the distance the locator parameter was back (which is up to
~ the number of items in the locator ^ 2).
The only client I was able to find which actually handles the headers
message is BitcoinJ, and it clearly expects no more than 2000 headers
See:
http://code.google.com/p/bitcoinj/source/browse/core/src/main/java/com/google/bitcoin/core/HeadersMessage.java#35
Additionally, the wiki clearly states that getheaders will only ever
return 2000 headers: https://en.bitcoin.it/wiki/Network#Messages
|
|
Sometimes a new block arrives in a new chain that was already the
best valid one, but wasn't marked that way. This happens for example
when network rules change to recover after a fork.
In this case, it is not necessary to do the entire reorganisation
inside a single db commit. These can become huge, and exceed the
objects/lockers limits in bdb. This patch limits the blocks the
actual reorganisation is applied to, and adds the next blocks
afterwards in separate db transactions.
|
|
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.
|
|
|
|
|
|
|
|
|
|
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.
|
|
Design goals:
* Only keep a limited number of addresses around, so that addr.dat does not grow without bound.
* Keep the address tables in-memory, and occasionally write the table to addr.dat.
* Make sure no (localized) attacker can fill the entire table with his nodes/addresses.
See comments in addrman.h for more detailed information.
|
|
|
|
|
|
|
|
report "Satoshi" which is at least correct
|
|
Now the entire network upgraded to (initial) protocol version 209,
crtainl simplifications in the source code are possible.
|
|
|
|
Also report old and new best, and fork point.
|
|
|
|
|
|
Introduce an enum threadId, and use symbolic indices when accessing
vnThreadsRunning.
|
|
in the memory pool.
|
|
|