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

756 Commits

Author SHA1 Message Date
Mike Hearn
22f8034de8 Minor JavaDoc updates. 2013-01-16 17:55:46 +01:00
Mike Hearn
75e467dfc4 Make TestUtils.roundTripTransaction public. 2013-01-16 17:55:36 +01:00
Mike Hearn
ee715a5f59 Add some convenience getters to a couple of classes. 2013-01-16 17:55:36 +01:00
Mike Hearn
9382ee15e9 POM indentation fix. 2013-01-16 14:23:17 +01:00
Mike Hearn
a39dfddead Silence a newly noisy MemoryPool debug log, as we now expect to receive un-announced transactions in several cases (dep download, Bloom filtering) 2013-01-16 13:20:55 +01:00
Mike Hearn
8923af5785 Fix typo that prevented connection timeouts from being set properly. 2013-01-15 14:17:15 +01:00
Mike Hearn
4254e276fb Clean up Peer.java a bit - remove the custom future implementation and use Guava futures instead. 2013-01-14 22:30:32 +01:00
Mike Hearn
e4e4e45a47 Allow re-signing of transactions and re-sign after adjusting the sequence number. 2013-01-12 14:47:43 +01:00
Mike Hearn
916e33254f Resolve some race conditions.
It was possible that during saving of a wallet a network thread would update the confidence metrics due to broadcast announcements. This change makes TransactionConfidence use a COW list so the broadcast peer set can be iterated over safely. Resolves issue 277.
2013-01-12 14:27:49 +01:00
Mike Hearn
9a65d4cab8 Move ping timer cancellation to after channel close during PeerGroup shutdown.
Check if the service is running before trying to re-ping a peer.
Attempts to solve a shutdown race. Updates issue 275.
2013-01-12 14:27:49 +01:00
Mike Hearn
89c611d86b Always use getLockTime in isFinal. 2013-01-12 14:27:49 +01:00
Mike Hearn
a6f1233b4e Delete some 0.5 -> 0.6 migration code from WalletTool. 2013-01-12 14:27:49 +01:00
Mike Hearn
b5b43f3a15 Better support for lock timed transactions.
Lock times are now included in various toString dumps.
Transactions can estimate their lock time when the time is specified as a block number.
Add support to WalletTool for creating timelocked transactions.
2013-01-12 14:26:59 +01:00
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