Commit Graph

508 Commits

Author SHA1 Message Date
Mike Hearn
6c1e3aa49a Comment fixes 2012-04-05 12:15:05 +02:00
Mike Hearn
d82f102b4b Introduce a new MemoryPool abstraction and use it for tracking peer confidences. This replaces the previous, less explicit system which had each peer try and track all transactions it'd seen in a per-peer pool.
This makes experimental usage of weak references and a reference queue to make the MemoryPool only bother tracking transactions that were retained by some other part of the program, ie, because they were relevant to the wallet. This stops the memory usage from bloating due to lots of large transactions flying around the network whilst still letting us intelligently monitor how many peers announced transactions without tight coupling between components.

Note that we still need the cap on the pool size because otherwise you could DoS a bitcoinj based program by sending it lots of fake transactions it found interesting. The DoS potential still exists but is a bit different now.
2012-04-05 12:14:36 +02:00
Mike Hearn
dc42630526 Invoke transaction confidence listeners when a new peer broadcasts the given transaction. Use EventListenerInvoker to run the listeners. 2012-04-05 12:12:17 +02:00
Mike Hearn
6368862ffe Clear out some more FindBugs warnings. 2012-04-04 23:52:02 +02:00
Mike Hearn
de1f5b8726 Add a findbugs exclusion file. 2012-04-04 22:45:13 +02:00
Mike Hearn
eb490f7168 Stop the main thread as the peer group thread is now daemonized. 2012-04-04 17:38:05 +02:00
Mike Hearn
b899b0acd3 BitCoin -> Bitcoin 2012-04-04 17:37:47 +02:00
Mike Hearn
8fc09f5808 Make network parameters to BitcoinURI optional. 2012-04-02 17:36:47 +02:00
Mike Hearn
9075561993 Support for discovering the network parameters from an address. Different exception type for wrong network parameters so chain-crossing can be handled differently. 2012-04-02 17:10:41 +02:00
Mike Hearn
11117dacbe Be super-explicit in the error message for calling getFromAddress on a coinbase transaction input. 2012-04-02 17:10:41 +02:00
Mike Hearn
0c90081c12 Make wallet tool compile to a minimized, bundled JAR so it can be used standalone, and change the wallet-tool script to use it that way. It makes running much faster. 2012-04-02 16:13:45 +02:00
Mike Hearn
628cbb6a1d Replace all asserts with Preconditions, which are always enabled. Updates issue 132. 2012-04-02 14:09:52 +02:00
Mike Hearn
3e5f796407 Add a dependency on Guava base libraries and replace a few asserts with Preconditions, which means they will always run including in production code. Fix a bug revealed by this (IntelliJ does not run unit tests with assertions enabled!) 2012-04-02 13:40:20 +02:00
Mike Hearn
2e451800d1 Update comments/exception message in Peer.getPeerBlockHeightDifference() 2012-04-02 13:25:04 +02:00
Miron Cuperman
3bc999a032 Properly close connecting peers.
Keep a collecting of pending peers.  Better socket closing.

Update issue 161.
2012-03-27 10:28:06 -07:00
Miron Cuperman
1e52a6eccc Catch certain exceptions when trying to close socket.
The socket might not be fully connected, so shutdownInput/Output can
fail.

Resolves issue 161.
2012-03-26 16:15:40 -07:00
Miron Cuperman
9474eaa0d4 Change NetworkConnection API to separate connect method.
This allows the Peer to close the connection earlier when connect()
takes a long time.

Resolves issue 161.
2012-03-26 15:23:14 -07:00
Miron Cuperman
92398d2c47 Check whether Peer should stop after each message.
Buffering could cause a delay in stopping if we only depend on socket
being closed.

Resolves issue 161.
2012-03-26 12:17:48 -07:00
Mike Hearn
a77d071d35 Catch exceptions thrown during signature checking. Some versions of Android cannot reliably check ECDSA signatures! Resolves issue 160. 2012-03-26 15:39:10 +02:00
Miron Cuperman
58971b6728 Throw an exception rather than assert on trying to get from address of generation transaction 2012-03-23 16:58:06 -07:00
Miron Cuperman
91a5949930 Additional level of locking to work around Android issue
Resolves issue 153.
2012-03-23 13:44:19 -07:00
Miron Cuperman
4f0c10bd2d Expose correct version message.
Resolve issue 158.
2012-03-23 12:57:47 -07:00
Miron Cuperman
576650142c Lock in BOBS on creation, do not swallow non-IO exceptions 2012-03-23 12:53:54 -07:00
Miron Cuperman
4b1c32584f Lock BlockStore files to prevent concurrent access.
Resolves issue 153.
2012-03-23 10:53:54 -07:00
Miron Cuperman
7f6d636cec Expose several useful Peer fields, for issue 158. 2012-03-19 09:40:17 -07:00
Mike Hearn
a119286b29 POM changes and refactorings from Gary. 2012-03-16 13:20:50 +01:00
Mike Hearn
6e162057c1 Removed IML files from git. 2012-03-13 19:00:33 +01:00
Mike Hearn
0e52c98c45 Use the standard Maven directory layout, rename "lib" to "core". Mavenize submodules. 2012-03-13 18:57:03 +01:00
Mike Hearn
216deb2d35 Re-organize the source tree so people can depend on bitcoinj without pulling in the examples, tools, or dependencies thereof. 2012-03-11 20:01:12 +01:00
Mike Hearn
a86ca77a58 Move to 0.5-SNAPSHOT 2012-03-09 15:34:34 +01:00
Mike Hearn
74b2f6c172 Update version number to 0.4 from 0.4-SNAPSHOT. Remove the TODO file. Sync contributors list in the POM with the AUTHORS file. 2012-03-09 15:33:04 +01:00
Mike Hearn
2e319dec90 Fire onCoinsSent/Received from commitTx() so it is called when using sendCoins[Async]. Resolves issue 154. 2012-03-07 14:45:12 +01:00
Miron Cuperman
bb97da6a5a Fix race condition on PeerGroup shutdown.
peers can be null in handlePeerDeath if we are shutting down.
Remove redundant numPeers() - use numConnectedPeers().
Rename getPeers() to getConnectedPeers()

Resolves issue 147.
2012-03-06 12:49:45 -08:00
Miron Cuperman
789798bae0 Serialize key creation time.
Resolves issue 151.
2012-03-03 14:00:05 -08:00
Mike Hearn
0d195e17c8 Lower the priority of the PeerGroup thread and daemonize it. 2012-03-02 15:32:58 +01:00
Mike Hearn
0b20b47c0c Clear another FindBugs warning in PeerGroup. 2012-03-02 15:24:20 +01:00
Mike Hearn
32a2be53c4 Make adding/removing event listeners lock PeerGroup. Take out use of synchronizedList as it's redundant. Resolves issue 148. 2012-03-02 15:15:36 +01:00
Mike Hearn
31463c506f Use EventListenerInvoker in PeerGroup, and clear a FindBugs warning about an unlocked access to the running property. 2012-03-02 15:08:55 +01:00
Mike Hearn
b25446271a Synchronize on event listeners in EventListenerInvoker. 2012-03-02 15:08:36 +01:00
Mike Hearn
001afa9ae2 Print TX values in Wallet.toString() 2012-03-01 18:56:12 +01:00
Mike Hearn
0a473a8d76 Remove an unnecessary save point in ToyWallet. 2012-03-01 18:56:02 +01:00
Mike Hearn
40bd728703 Add a Transaction.getValue(Wallet) method. 2012-03-01 18:55:46 +01:00
Mike Hearn
ddb6da155b Merge branch 'master' of https://code.google.com/p/bitcoinj 2012-03-01 18:07:30 +01:00
Miron Cuperman
feb85a13d3 Remove private key from ECKey.toString and put it in toStringWithPrivate 2012-02-29 14:50:57 -08:00
Mike Hearn
1df679cd17 Change how wallet callbacks are run in the case of a tx that both sends and receives coins from the wallet (common case). 2012-02-24 15:25:38 +01:00
Mike Hearn
c8e76a8f9b Log slow reads in BOBS. 2012-02-24 15:25:06 +01:00
Jim Burton
812ca60b9b BIP21 bitcoin URI implementation.
Resolves issue 143.
2012-02-23 11:29:48 -08:00
Mike Hearn
168a5a40e1 Fix a minor bug in the ChainSplitTests 2012-02-19 15:04:02 +01:00
Mike Hearn
54a2a71460 Replace WalletEventListener.onDeadTransaction with a generic confidence changed callback, this simplifies the case of listening for all confidence changes in all wallet transactions and gives a single place to save the wallet from. 2012-02-19 15:01:30 +01:00
Mike Hearn
68424281c5 Print out alert messages to the log. 2012-02-19 12:22:43 +01:00