3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-30 23:02:15 +00:00
Commit Graph

693 Commits

Author SHA1 Message Date
Mike Hearn
48cdc1d9e7 improve findbugs exclusions 2013-01-12 14:26:59 +01:00
Mike Hearn
f2db0028ca Slightly improve wallet-tool help text. Updates issue 273. 2013-01-12 14:26:59 +01:00
Mike Hearn
9da08d2036 Try all returned IP addresses in IRC discovery and use the given timeout.
Resolves issue 268. Resolves issue 269.
2013-01-12 14:26:59 +01:00
Mike Hearn
1454261ff3 Use the testnet3 channel in PrintPeers. 2013-01-11 22:14:12 +01:00
Mike Hearn
682033aef6 Actually use the provided IRC server name in IrcDiscovery. Resolves issue 266. 2013-01-11 21:58:45 +01:00
Mike Hearn
93870110c3 Use blocking PeerGroup startup in WalletTool 2013-01-10 14:12:58 +01:00
Mike Hearn
43e8752ef8 Make PeerGroup.addAddress adjust the number of requested connections. 2013-01-10 14:12:50 +01:00
Mike Hearn
dd9e0d5d0d Fix my previous buggy commit that changed Utils.bitcoinValueToFriendlyString 2013-01-10 13:26:19 +01:00
Mike Hearn
d268270d7b Use compressed pubkeys by default. Resolves issue 111. 2013-01-09 23:45:24 +01:00
Mike Hearn
0bdfa7b635 Better formatting in Utils.bitcoinValueToFriendlyString 2013-01-09 23:45:23 +01:00
Mike Hearn
f2a6e41c82 Don't abuse BigIntegers in WalletTool/Utils when parsing hex pubkeys. 2013-01-08 17:33:19 +01:00
Mike Hearn
ee5f881c51 Run TransactionConfidence listeners with the confidence object unlocked when markBroadcastBy is called. Resolves issue 270. 2013-01-07 11:13:33 +01:00
Mike Hearn
ae6b2fbd4d Improvements to the ECKey class:
- Implement ECDSA key recovery.
- Use it to implement sign/verifymessage functionality that's compatible with Bitcoin-Qt.
- Redesign the signing APIs a bit.
2013-01-06 22:07:55 +01:00
Mike Hearn
7fc325900c Clarify some parameter names in Sha256Hash and add a utility method. 2013-01-06 21:57:09 +01:00
Mike Hearn
7e8ed913ec Use ChannelGroups for shutdowns. This cleans up the code and makes the PeerGroup shutdown futures work correctly. 2013-01-04 18:29:47 +01:00
Mike Hearn
972c19a95f Use canonical path to the wallet destination file. Resolves issue 265. 2013-01-04 17:54:17 +01:00
Mike Hearn
12a652bd1e Close the temporary FileInputStream created in Sha256Hash.hashFileContents. Updates issue 265. 2013-01-04 17:38:05 +01:00
Matt Corallo
44865a3c50 Fix NullPointerException if using chain == null in PeerGroup 2013-01-04 17:33:12 +01:00
Matt Corallo
0208b426f5 Add a few more tests to FullBlockTestGenerator.
...including one which (somewhat) tests the optimally encoded size
stuff.
2012-12-31 15:56:06 +01:00
Matt Corallo
810b03dd0a Give Blocks/Transactions an idea of their optimally-encoded size.
In the case of Blocks/Transactions which are encoded using VarInts
which are not optimally encoded, we need to compare MAX_BLOCK_SIZE
with the optimally encoded size, not the actually encoded size.
2012-12-31 15:54:19 +01:00
Matt Corallo
009939f9be Give VarInt a concept of originally serialized size.
VarInts have multiple encodings, and during parsing we need to know
the size of the actually encoded form, not the size of the optimal
encoding.
2012-12-31 15:53:11 +01:00
Matt Corallo
95b5e0d894 Make FullPrunedBlockStore/Chain upgrade-friendly.
This does several things to support the ability to upgrade from a
BlockChain to a FullPrunedBlockChain backed by the same
FullPrunedBlockStore:
 * Add two methods to FullPrunedBlockStore to allow it to keep
   track of two chain heads - one verified, one normal.
 * Change preSetChainHead in AbstractBlockChain to doSetChainHead so
   that FullPrunedBlockChain and BlockChain can set only the
   appropriate chain head
 * Add FullPrunedBlockStore.getOnceUndoableStoredBlock.
   This allows a BlockChain to request only StoredBlocks which
   were, at one point, associated with a StoredUndoableBlock,
   effectively splitting FullPrunedBlockStore into two independent
   BlockStores (one FullPruned, one normal).
 * Add/use AbstractBlockChain.getStoredBlockInCurrentScope which
   relies on the above additions to FullPrunedBlockStore to properly
   utilize one FullPrunedBlockStore as two separate block stores
   depending on the BlockChain instance used.
   Note that this is not used everywhere in AbstractBlockChain as,
   barring something being insanely broken, the prev block of a
   block in current scope will be in current scope.
2012-12-27 16:34:27 +00:00
Mike Hearn
4e0f5d8903 FindBugs: make random an object field rather than a disposable temporary. 2012-12-26 18:57:03 +00:00
Mike Hearn
bf3a8dc085 Clear a minor FindBugs warning. 2012-12-26 18:55:17 +00:00
Mike Hearn
671a5aec18 Add a TransactionInput.verify() method that checks signatures and use it from the basicSpending test to ensure we generate valid signatures/scripts. 2012-12-26 18:14:39 +00:00
Mike Hearn
2f0d4cdbd8 Update Script javadoc. 2012-12-26 18:01:48 +00:00
Mike Hearn
273548c863 Take ping time into account when performing peer selection. 2012-12-25 01:23:28 +00:00
Mike Hearn
3197be51ea Minor simplifications. 2012-12-25 01:23:16 +00:00
Mike Hearn
ea3fca970c Incorporate protocol version into download peer selection logic. 2012-12-25 00:28:49 +00:00
Mike Hearn
ac61578e8a Use a COW list in Peer instead of protecting pendingPings under the peer lock. 2012-12-24 23:57:28 +00:00
Mike Hearn
22ff79dd8a Re-evaluate download peer when a new peer connects. Add unit tests for selecting the best peer. 2012-12-24 23:48:48 +00:00
Mike Hearn
ffc953abc8 Don't hold the Peer lock whilst invoking a ping callback. 2012-12-24 23:47:14 +00:00
Mike Hearn
eb7c4be136 Fix lock inversion. 2012-12-24 23:33:13 +00:00
Mike Hearn
b71015a297 Convert table co-ordinates correctly in PeerMonitor. 2012-12-24 22:53:17 +00:00
Mike Hearn
8e91459dcc Fix a bug that could cause failure to reach the requested number of peers if peer connections failed immediately due to unroutable addresses. 2012-12-24 22:33:04 +00:00
Mike Hearn
07011be796 Introduce a PeerGroup method for calculating the most common chain height.
Use it to make peer selection a little smarter.
Render pending peers and peers that are reporting un-common chain heights in PeerMonitor.
2012-12-24 22:32:16 +00:00
Mike Hearn
2a55c58460 Make PeerGroup startup blocking in the unit tests. 2012-12-24 21:27:49 +00:00
Mike Hearn
7d7e76a3b0 Deduplicate peers retrieved from peer discovery. Resolves issue 260. 2012-12-24 17:51:40 +00:00
Mike Hearn
75c007fab3 Fix unit tests. 2012-12-24 16:35:52 +00:00
Mike Hearn
a54e2e96eb Fix a bug in difficulty calculation logic that is revealed by testnet3. It should not impact the main net. Resolves issue 262. Rethrow block verification errors with a message containing the block. 2012-12-24 16:12:13 +00:00
Mike Hearn
9639b45ad8 BitCoin -> Bitcoin 2012-12-24 16:11:11 +00:00
Mike Hearn
93893e10ad Make PeerGroup use the Guava services framework. Makes start/stop optionally non-blocking. Resolves issue 258. 2012-12-21 23:03:15 +01:00
Mike Hearn
826aafd3e0 Make H2 non required. 2012-12-16 13:38:46 +01:00
Mike Hearn
eacda0bdfc Decouple the wallet from the block chain by introducing a BlockChainListener interface, and making the Wallet implement it. Resolves issue 94. 2012-12-14 17:04:30 +01:00
Mike Hearn
5abd546eb2 Update the AbstractBlockChain javadoc. 2012-12-14 16:33:37 +01:00
Mike Hearn
f6a498c241 Remove the redundant Wallet.isTransactionRelevant(..., includeDoubleSpending) parameter, as it was always set to true. 2012-12-14 16:24:24 +01:00
Mike Hearn
ca629e330f Duplicate a transaction before sending to wallets beyond the first. Resolves issue 257. 2012-12-14 15:24:22 +01:00
Mike Hearn
1710be5b06 Fix typo in PeerGroup c'tor javadoc. Spotted by Matt. 2012-12-12 22:23:55 +01:00
Mike Hearn
590fd82fdc Fix a regression introduced by the block height accessor changes that prevented DownloadListener from triggering. Fix more inconsistent locking issues. 2012-12-11 00:22:25 +01:00
Mike Hearn
372a23fbfe Fix more inconsistent synchronization bugs. 2012-12-11 00:08:46 +01:00