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

639 Commits

Author SHA1 Message Date
Matt Corallo
425126689e Move subsidy decrease block count constant to NetworkParameters. 2012-10-08 18:26:28 +02:00
Mike Hearn
7c636d7ecc Move block inflation calculator to be a static method of Block. In future this will move again to NetworkParameters. 2012-10-08 18:05:14 +02:00
Matt Corallo
90f5ab7e47 Check transaction fees and block subsidies in conenctTransactions.
After this commit, bitcoinj implements all non-script-executing
checks at block connect time that the reference implementation
does.
2012-10-08 18:05:14 +02:00
Matt Corallo
ef6e1b89ca Check depth of spent coinbases during connectTransactions. 2012-10-08 18:05:14 +02:00
Matt Corallo
c789b757f3 Count P2SH SigOps the way the reference client does. 2012-10-08 18:05:14 +02:00
Matt Corallo
7ca87c078c Add block timestamp and transaction finalization checks.
This brings bitcoinj's block connection up to the reference
client's AcceptBlock().
2012-10-08 17:32:45 +02:00
Mike Hearn
5e0d4a168e Add a note that spending the genesis transaction should be impossible. 2012-10-08 17:13:49 +02:00
Mike Hearn
fd941fe46a Don't recalculate fast catchup time to avoid hitting an assert. 2012-10-08 17:13:37 +02:00
Matt Corallo
6a96b0c392 Tweak ToyWallet to allow for easy switching to FullPrunedBlockChain 2012-10-08 17:12:41 +02:00
Matt Corallo
0cf2325640 Add a H2-backed FullPrunedBlockStore.
This adds yet another dependency to bitcoinj, but Derby's
performance (especially on DELETE operations) was godawful...
2012-10-08 17:03:14 +02:00
Matt Corallo
4018af8d51 Implement a Transaction.verify() to mimic Satoshi CheckTransaction 2012-10-08 16:40:44 +02:00
Matt Corallo
626ff2fa2c Verify SigOp counts when verifying Blocks. 2012-10-08 16:34:55 +02:00
Matt Corallo
1cbd5c07b4 Make a block with no txn a VerificationException, not Precondition 2012-10-08 16:29:17 +02:00
Matt Corallo
dfebcc83ab Add a few test cases to test FullPrunedBlockChains. 2012-10-08 16:28:57 +02:00
Matt Corallo
0bdb9bc6f4 Add the option to use a valid input in createNextBlock. 2012-10-08 16:15:21 +02:00
Matt Corallo
de2a6db666 Add a FullPrunedBlockChain class which can do full verification. 2012-10-08 16:12:47 +02:00
Mike Hearn
2a9c5b32d9 Add a checkpoint at height 200,000 2012-10-08 15:43:45 +02:00
Matt Corallo
c3ff3d112e Add checkpoint support and use it in AbstractBlockChain.
This greatly simplifies block connection logic as it does not need
to consider reorgs through non-BIP30-compliant blocks.
2012-10-08 15:43:45 +02:00
Matt Corallo
8edd6c5399 Add basic support for using AbstractBlockChains in Peer/PeerGroup. 2012-10-08 15:43:45 +02:00
Matt Corallo
03d8c71df3 Add a FullPrunedBlockStore interface and in-memory implementation. 2012-10-08 15:43:44 +02:00
Matt Corallo
548333bc6f Refactor BlockChain to make it more extensible.
This creates a new AbstractBlockChain abstract class which
BlockChain extends.
It continues to have a createable BlockChain class to avoid
changing the API too much.
2012-10-08 15:16:24 +02:00
Mike Hearn
74042b8ca3 Fix minor bug in PingService. 2012-10-08 14:36:35 +02:00
Matt Corallo
b4215e8b01 Add a few Storage classes which avoid storing unnecessary data.
Specifically, this adds:
* StoredTransaction, which avoid having to store the entire
  transaction when we only need its inputs+outputs.
* StoredTransactionOutput, which avoids having to store the entire
  parentTransaction just to get the hash and index.
* TransactionOutputChanges, which is used to store two lists of
  StoredTransactionOutputs, one for the created set and one for
  the spent set.
* StoredUndoableBlock, which can store either only
  TransactionOutputChanges or only StoredTransactions so that the
  block can be more easily connected/disconnected at will.
2012-10-04 00:32:14 +02:00
Mike Hearn
8a4c34edd0 Improvements to the toy wallet example. Now shows received transactions in a list. Uses auto save. Testnet3. Uses the new event to refresh the wallet tx list. Lets you copy the address to the clipboard with one click. Smaller and simpler than before! 2012-10-04 00:24:51 +02:00
Matt Corallo
f2d9a6162d Fix a number of issues with message length caching. 2012-10-04 00:24:51 +02:00
Mike Hearn
deb9da67aa Add a WalletEventListener.onWalletChanged() method that is designed for GUI apps to refresh their tx list. Resolves issue 222. 2012-09-29 18:32:22 +02:00
Mike Hearn
946d25548f Remove dead code that was used for appearsIn -> appearsInHashes migration, which pre-dates protobuf wallets. Make a few package-private members fully private. 2012-09-29 16:37:04 +02:00
Mike Hearn
cca393eea5 Use a HashSet instead of a TreeSet. Resolves issue 250. 2012-09-28 14:57:32 +02:00
Simon Vermeersch
232d2cd51d testnet3 2012-09-28 14:44:26 +02:00
Mike Hearn
78dedcc9ba Re-organize how transaction confidence listeners end up being called. Ensure WalletEventListener.onTransactionConfidenceChanged is always called for every building transaction after every block. Resolves issue 251. 2012-09-27 18:43:31 +02:00
Matt Corallo
a9cdf99135 Fix comment example for buildMerkleTree 2012-09-24 18:03:41 +02:00
Mike Hearn
254393253c Version 0.7-SNAPSHOT 2012-09-24 15:27:30 +02:00
Mike Hearn
7b4dc184f7 Fix a bug that could cause us to fail the transition between downloading headers and blocks. 2012-09-09 15:28:52 +02:00
Mike Hearn
793254b6f5 Quieten some debug logs. 2012-09-09 15:26:06 +02:00
Mike Hearn
04772a7aa8 Allow setting the creation time for newly created keys (this is useful for testing) 2012-09-09 15:25:58 +02:00
Mike Hearn
d3a540bb1e Fix a bug where we'd attempt to migrate depths of pending transactions. 2012-09-09 14:45:34 +02:00
Mike Hearn
7867841579 Fix an off by one error in tx depth migration. 2012-09-08 23:28:26 +02:00
Mike Hearn
087a4f2447 Close block store after finding height for wallet import. 2012-09-07 15:11:32 +02:00
Mike Hearn
8003266a66 Set the tx depth fields whilst loading 0.5 era wallets if the chain height is provided before load. This does NOT migrate workDone as that'd involve scanning potentially the entire block store and nobody uses this data much today. Resolves issue 240. 2012-09-06 18:50:35 +02:00
Mike Hearn
572f2a4f4e Implement the ability to explicitly set a fee in the Wallet.SendRequest. Does not yet auto-calculate the correct fees. Resolves issue 45. Resolves issue 245. 2012-09-06 17:45:04 +02:00
Mike Hearn
915a2adb10 Fix a NullPointerException introduced by the TCPNetworkConnection helper APIs. 2012-09-06 17:25:43 +02:00
Mike Hearn
48b4eb95a6 Update WalletTool to new send API. 2012-09-06 15:05:20 +02:00
Mike Hearn
29d5dcd424 Re-organize the wallet sending APIs to take a SendRequest. Full details of the API changes are sent to the list. 2012-09-06 14:22:05 +02:00
Mike Hearn
8162aa0ed1 Use current time as unit test chain genesis block time. Resolves a weird issue where the unit tests suddenly broke as the previous unit test genesis time was equal to testnet genesis time. 2012-09-06 12:37:00 +02:00
Mike Hearn
38aabdfa24 JavaDoc improvements and other minor tweaks. Remove a few things that are not really meant to be public APIs. 2012-08-30 23:46:54 +02:00
Mike Hearn
2961f65594 Use the new TCPNetworkConnection.connectTo API in PrintPeers, act as an example of the Guava futures API too. 2012-08-30 23:16:37 +02:00
Mike Hearn
8453654b85 Add a TODO in PeerGroup 2012-08-30 23:16:15 +02:00
Mike Hearn
26d55f889d Add a convenience API to TCPNetworkConnection to get a handshaked connection. Update JavaDocs. 2012-08-30 23:16:05 +02:00
Mike Hearn
dee14b7109 Use JDK logging in the examples module. 2012-08-30 23:14:00 +02:00
Mike Hearn
5c8bfbda8b Delete a bit of dead code in PeerGroup. 2012-08-30 15:49:52 +02:00