3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-31 07:12:17 +00:00
Commit Graph

492 Commits

Author SHA1 Message Date
Mike Hearn
23a960e0f4 Fix a bug revealed by the better wallet consistency checks - after reprocessing an unincluded transaction at the end of a re-org, check if connected transactions now need to be moved to the spent pool. 2012-05-15 23:45:59 +02:00
Mike Hearn
2081c2234b Ignore blocks that are sent to us which we never requested. Updates issue 180. 2012-05-15 22:39:20 +02:00
Mike Hearn
1b1457449a Add a BitcoinURI.convertToURI variant that takes a String instead of an Address. Remove test for null param -> IllegalArgumentException as that's not consistent with the rest of the library. Resolves issue 152. 2012-05-14 20:57:14 -07:00
Mike Hearn
3d5a7ea7ec Don't use peers that claim to have a block chain and then report a height of zero. These are probably buggy reimplementations of the protocol. 2012-05-14 20:52:06 -07:00
Mike Hearn
c41b6d74fa Better base58 encoding/decoding that resolves some edge cases. Patch from Vasile Rotaru. 2012-05-09 11:12:45 -07:00
Mike Hearn
0a3189c3b4 WalletTool: fix --help and allow privkeys/pubkeys to be parsed as hex or base58. 2012-05-02 17:56:05 +02:00
Mike Hearn
1087d837e5 Log the IP being used to connect to IRC. 2012-05-02 17:17:55 +02:00
Mike Hearn
ff770a8d83 Add an explicit test in WalletTest.blockChainCatchup for confidence levels. 2012-05-02 16:59:50 +02:00
Miron Cuperman
fe9cbf8b7b Wallet.isConsistent tests
Resolves issue 184.
2012-05-01 18:57:03 -07:00
Miron Cuperman
6a82462d2d More Wallet consistency checks 2012-05-01 18:45:48 -07:00
Mike Hearn
a0da0c548f Refactor transaction signing code so users can get the signature hash of an arbitrary input.
Also add/fix comments in bitcoin.proto and make the Transaction.pool field optional.
2012-04-15 19:07:30 +02:00
Mike Hearn
7f5c8dc3a8 Set outpoint.fromTx during TransactionInput.connect even in the conflict case. Resolves issue 181. Also introduce a helper for creating double spends and rewrite the test case for this in WalletProtobufSerializer to cover more codepaths. Add a comment noting that in the double spending case the overriding transaction isn't presently being stored in the wallet. 2012-04-15 17:51:31 +02:00
Mike Hearn
9fa25f990b Make it easier to understand the wallet code by using an enum instead of a bool for TransactionInput.connect() 2012-04-15 16:26:11 +02:00
Mike Hearn
6deeaaf8ac One more minor consistency cleanup. 2012-04-15 16:15:17 +02:00
Mike Hearn
73a5d95bea Introduce additional comment and some minor reformatting / simplification of the protobuf serializer. 2012-04-11 23:08:39 +02:00
Mike Hearn
8796705987 Better internal sanity checking in the wallet deserializer and simplify the code. Also reformat and introduce another helper method. 2012-04-10 23:57:55 +02:00
Mike Hearn
0fb81a7288 Fix output directory of protobuf regeneration. 2012-04-08 14:27:08 +02:00
Mike Hearn
513a75b4ba Download transactions from whichever peer announced them first. 2012-04-08 14:26:53 +02:00
Mike Hearn
2023e05d7e Fix detection of end of block chain download when syncing a wallet with no keys. 2012-04-08 00:13:01 +02:00
Mike Hearn
71754929e4 Support pubkey only keys in the protobuf serializer. 2012-04-07 23:45:40 +02:00
Mike Hearn
cf30280767 Catch up with new testnet rules. Resolves issue 164. 2012-04-07 23:28:18 +02:00
Mike Hearn
2f904e7a37 Fix unit test. 2012-04-07 17:02:00 +02:00
Mike Hearn
0ab36f7839 Some more wallet-tool fixes/improvements. 2012-04-06 18:41:53 +02:00
Mike Hearn
b008cd0388 Don't validate difficulty transitions on the testnet as there was a recent rule change, and nobody cares about security on testnet anyway. 2012-04-06 18:41:40 +02:00
Mike Hearn
40e4ac0a49 Restore error message that got accidentally taken out. 2012-04-06 18:40:51 +02:00
Mike Hearn
4e3d5313e6 Fix issue 166. Consider intra-block dependencies when deciding whether to send transactions to the wallet. 2012-04-06 18:03:07 +02:00
Mike Hearn
577318b9ea Start auto-migration to protobuf wallets. 2012-04-06 16:02:00 +02:00
Mike Hearn
265c76db59 Don't crash if trying to print a transaction with no inputs 2012-04-06 16:01:44 +02:00
Mike Hearn
a170372562 Add a static method to go from string ID to NetworkParameters and use it to simplify the WalletProtobufSerializer API. 2012-04-06 14:58:36 +02:00
Mike Hearn
ece8f548a9 Support for sending money from wallet-tool. 2012-04-06 14:37:49 +02:00
Mike Hearn
b3e092a5e8 More logging in Peer/PeerGroup 2012-04-06 14:36:54 +02:00
Mike Hearn
c400a7c756 Peer.java: change trace to info on receiving a block
Wallet.java: print more info to logs if wallet sizes are inconsistent
2012-04-06 13:39:41 +02:00
Mike Hearn
b7379d562f WalletTool improvements:
- Can now wait for blocks, wallet-relevant transactions or for wallet balance to meet a given condition
 - Simplified the code somewhat
2012-04-05 20:34:31 +02:00
Jonny Heggheim
7bf9724079 Fix issue 174, replaced all File usage with TemporaryFolder rule in JUnit. 2012-04-05 17:10:36 +02:00
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