Commit Graph

508 Commits

Author SHA1 Message Date
Mike Hearn
0e198e68e8 Add top 50 blocks to the block locator. Should make chain split handling more robust. 2012-02-13 23:39:23 +01:00
Mike Hearn
2f72eb64d7 Note that there is a race in MockNetworkConnection. Fixing it will have to wait until I am less tired. 2012-02-13 23:32:14 +01:00
Mike Hearn
e8548a197c Make Message inner exception class static, for efficiency. Clears a FindBugs warning. 2012-02-13 23:03:15 +01:00
Mike Hearn
cbf60e1056 Clamp the blocksLeft parameter of the PeerEventListener.onBlocksDownloaded() callback to zero. It was being set from the difference between chain height and peer advertised chain height, which can legitimately be negative, but this is confusing and resulted in a bug in DownloadListener which could cause it to never correctly flag the end of chain download. Resolves issue 86. 2012-02-13 22:02:13 +01:00
Mike Hearn
5fde54e8e3 Add an initVerbose() method to BriefLogFormatter. Note: this does not actually appear to work :( 2012-02-13 21:36:49 +01:00
Mike Hearn
57d518aba9 Fix an issue in block chain handling, whereby a duplicate block received that was not the chain head could result in wallet corruption and bogus "block forks the chain" messages. Resolves issue 135. 2012-02-13 21:36:09 +01:00
Mike Hearn
a70c868f3f Update the README to use correct capitalization of Bitcoin and reference the wallet-tool script. 2012-02-13 20:48:26 +01:00
Mike Hearn
1d772a059f Add a little shell script that invokes WalletTool via maven. 2012-02-13 20:48:05 +01:00
Mike Hearn
5bc9e49941 Lower the level of a spammy log line. 2012-02-13 20:47:52 +01:00
Mike Hearn
d08f2f7808 WalletTool: allow specification of debug levels and force a particular peer to be used. Add a bit of logging to WalletTool itself. 2012-02-13 20:47:32 +01:00
Mike Hearn
2c93dfba32 More JavaDocs for PeerAddress and default the port for the prodnet rather than zero, which is pretty useless. 2012-02-13 20:46:42 +01:00
Mike Hearn
1204a901e6 Make the semaphore in DownloadListener private 2012-02-13 20:46:14 +01:00
Mike Hearn
dec8d5aeb8 Fix a minor bug in Peer.java where it wasn't always correctly constructing the block locator. Resolves issue 138. Bug found by Vasile Rotaru. 2012-02-12 22:41:03 +01:00
Mike Hearn
cfd06195a0 WalletTool: allow control of logging from the command line. Change how block chain download is waited for. 2012-02-12 22:25:09 +01:00
Mike Hearn
11dcb0a682 Log chain height in BlockChain c'tor 2012-02-12 22:25:09 +01:00
Miron Cuperman
af826772c5 Fast shutdown for PeerGroup.
Concurrency safe peerDiscoverers

Resolves issue 118.
2012-02-10 09:09:56 -08:00
Mike Hearn
6597f01874 Handle the not-enough-funds case in sendCoinsAsync and sendCoins(PeerGroup ...). They got a NPE in this case during a recent refactoring. Resolves issue 136. 2012-02-10 17:00:29 +01:00
Mike Hearn
2d0891cf4b Add missing synchronized keywords to various Wallet methods that were missing them. Resolves issue 137. 2012-02-10 16:56:26 +01:00
Mike Hearn
d2e35cc744 Make GetBlocksMessage/GetHeadersMessage not compare equal despite identical contents, resolves issue 140. 2012-02-10 16:49:25 +01:00
Mike Hearn
21c5e14700 Fix a minor bug in AddressMessage. Patch from Vasile Rotaru. Resolves issue 138. 2012-02-10 16:44:57 +01:00
Mike Hearn
03db1a9636 Merge branch 'master' of https://code.google.com/p/bitcoinj
Conflicts:
	src/com/google/bitcoin/core/Transaction.java
2012-02-10 15:49:03 +01:00
Mike Hearn
6459f15202 First cut at a wallet manipulation tool. 2012-02-10 15:47:10 +01:00
Mike Hearn
0552acc286 Lower logging level for unrecognized script outputs. 2012-02-10 15:46:35 +01:00
Mike Hearn
8c2b46ea51 Put the creation timestamp in ECKey toString output. 2012-02-10 15:46:12 +01:00
Mike Hearn
781cb1f8d5 Use a slightly more sensible startup sequence for BoundedOverheadBlockStore to avoid log spam when creating a fresh chain. 2012-02-10 15:45:43 +01:00
Miron Cuperman
7cc23e3e6b Improved Transaction.toString 2012-02-09 10:28:15 -08:00
Mike Hearn
96a1e87f47 Correct a comment 2012-02-09 16:15:00 +01:00
Mike Hearn
82e426a7eb Print outpoint data in Transaction toString() output 2012-02-09 16:14:45 +01:00
Mike Hearn
23279aff5f Change order of outpoint printing to be more consistent with Bitcoin practice 2012-02-09 16:14:29 +01:00
Mike Hearn
9ba77a0d68 Prevent Derby unit test from writing a pointless log file. 2012-02-07 23:00:09 +01:00
Mike Hearn
d5aad396a3 Use temp dir under target/ for derby test, ensure we actually do delete the directory afterwards.
Resolves issue 129.
2012-02-07 22:50:58 +01:00
Mike Hearn
6f8ab7b40b Add a big pile of JavaDocs to the WalletProtobufSerializer. Also make its c'tor private, so usage is clearer. 2012-02-07 22:35:11 +01:00
Mike Hearn
db60bfc731 Provide network parameter IDs as constant strings. Make the "id" field of NetworkParameters private and make the getter upgrade the object using port as a heuristic if the field isn't present. Add a unit test to ensure we can convert old wallets to protobuf form. Resolves issue 134. 2012-02-07 22:34:39 +01:00
Mike Hearn
2b3e77bea9 Make a couple more Wallet methods public. 2012-02-07 21:49:12 +01:00
Mike Hearn
11a87317a4 Split transaction creation into building a template and then completing it. Completing a tx means adding inputs and possibly a change output to make the transaction valid. Also add a convenience addOutput() overload to Transaction. This makes it easier to create multi-sends.
Patch from Chris Rico.
2012-02-07 21:47:21 +01:00
Mike Hearn
b43b686264 Use finer grained locking in the BlockChain to make accessing the chain head responsive even whilst the chain is downloading and the object is under heavy load. This takes getChainHead() out of the profiles for ToyWallet and allows for removing the code added there to work around this issue. 2012-02-05 23:44:43 +01:00
Mike Hearn
7369c398ff Improve a comment and make Wallet.receivePending() public. 2012-02-03 15:42:30 +01:00
Mike Hearn
c1cb5c10d5 Improve a log message 2012-02-03 14:09:43 +01:00
Mike Hearn
fff2034408 Copy test wallet into build directory, fixes a failing test case. 2012-02-03 14:00:12 +01:00
Mike Hearn
b0739df2e5 Expose hashTransactionForSignature. The API will likely change in future. 2012-02-03 12:29:36 +01:00
Mike Hearn
b72c170086 API for setting version messages on outbound connections, and implementing BIP 14. Resolves issue 105. 2012-02-03 12:29:36 +01:00
Mike Hearn
7f82613559 Migrate old wallets to use transaction confidences, as much as possible, and add a unit test for deserializing old wallets. 2012-02-03 12:29:36 +01:00
Miron Cuperman
be8d3c3896 Get rid of some warnings 2012-02-02 14:51:31 -08:00
Miron Cuperman
69ee4c7729 Be lenient in parsing tx confidence protobuf, store pubkeys, cleanup 2012-02-02 10:18:08 -08:00
Miron Cuperman
1c28bd3972 Persist TransactionConfidence to protobuf 2012-02-02 09:49:08 -08:00
Mike Hearn
3d470ec3f2 Make BlockTest.testDate pass outside of CET. 2012-02-02 15:37:24 +01:00
Mike Hearn
9afa4bf6a5 Create the localhost address without relying on a method that does DNS lookups behind the scenes. Resolves issue 120. 2012-02-02 15:00:46 +01:00
Mike Hearn
6b2275890a Invoke onCoinsSent() when receiving a pending transaction that spends the wallets coins. 2012-02-02 14:49:46 +01:00
Mike Hearn
cf76cf064f Add a comment to the EventListenerInvoker class. 2012-02-02 14:48:23 +01:00
Mike Hearn
1a4acc18be Pubkeys are 65 bytes, not 32. 2012-01-26 18:40:24 +01:00