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

771 Commits

Author SHA1 Message Date
Matt Corallo
9cc9607c73 ScriptException extends VerificationExtension, code cleanup follows
Just cleans up code now that ScriptException extends
VerificationExtension.
2012-11-01 16:08:56 +01:00
Matt Corallo
739b2c6183 Add constructor to H2FullPrunedBlockStore to specify cache size. 2012-11-01 15:43:09 +01:00
Matt Corallo
a011948139 Avoid expensive calls to getClass().getSimpleName() in Message 2012-11-01 15:42:51 +01:00
Mike Hearn
9c124ac257 Close stream in BlockImporter 2012-11-01 15:41:52 +01:00
Matt Corallo
a036b68aa2 Refactor some Stored* classes that are worthless...
Specifically, this moves StoredTransaction to
MemoryFullPrunedBlockStore and uses custom serialization for
StoredTransactionOutput.
2012-11-01 15:41:52 +01:00
Matt Corallo
91cd289a5c Make getMessageSize() public 2012-11-01 15:33:57 +01:00
Matt Corallo
49d26f6e28 Make genesis coinbase unspendable. 2012-11-01 15:33:46 +01:00
Matt Corallo
282b58c5ea Add a BlockImporter tool to examples. 2012-11-01 15:29:15 +01:00
Matt Corallo
bf11bf08c3 Add data-driven Script tests from the reference client. 2012-11-01 15:21:06 +01:00
Mike Hearn
35ff3e1735 Add some comments to Script.java 2012-11-01 15:18:49 +01:00
Matt Corallo
050d70cf15 Validate P2SH in Script.correctlySpends 2012-11-01 15:07:17 +01:00
Matt Corallo
69f441b6c7 Make Script Verification multi-threaded in FullPrunedBlockChain. 2012-11-01 15:05:51 +01:00
Mike Hearn
c4d0364a60 Update a couple of copyright notices that missed Matts name. 2012-11-01 15:03:06 +01:00
Matt Corallo
5321352820 Add TransactionOutPoint.setIndex 2012-11-01 14:40:09 +01:00
Mike Hearn
da0f8a791b Re-throw wrapped ScriptException in FullPrunedBlockChain. 2012-11-01 14:40:05 +01:00
Matt Corallo
cba837cfef Verify scripts in FullPrunedBlockChain.connectTransactions 2012-11-01 14:37:53 +01:00
Matt Corallo
8ec3cdeb9c Add a Script.correctlySpends for Script execution verification. 2012-11-01 14:36:20 +01:00
Mike Hearn
8d1591183f Rename TransactionInput get/setSequence -> get/setSequenceNumber. The previous name could be confusing and was inconsistent. Add lots of comments to Transaction.hashForSignature. 2012-11-01 14:06:59 +01:00
Matt Corallo
40237f0549 Implement all SigHash types in hashTransactionForSignature. 2012-11-01 13:43:06 +01:00
Matt Corallo
2f2850610e Add a Script.removeAllInstancesOf(script object) 2012-11-01 13:40:05 +01:00
Matt Corallo
d7dc953da8 Add a startLocationInProgram field to ScriptChunk. 2012-11-01 13:34:48 +01:00
Mike Hearn
6a36dcd0ca Add hasKey method to Wallet. Also add addKeys method so keys can be added in bulk without triggering disk saves for each key. Resolves issue 255. 2012-11-01 13:32:32 +01:00
Mike Hearn
640db52cf4 Implement equals/hashCode on ECKey. Resolves issue 254. 2012-11-01 13:32:32 +01:00
Matt Corallo
45b89a1935 Use a generic block chain creator for Full Block Chain tests. 2012-10-24 16:44:53 +02:00
Matt Corallo
9585729398 Remove redundant TransactionOutput constructor 2012-10-24 16:44:53 +02:00
Matt Corallo
f3d9c02841 Return false when calling Chain.add on an orphan we already have 2012-10-24 16:44:52 +02:00
Matt Corallo
599d4a671c Add a testnet-in-a-box mode.
Which allows connecting to a peer with only the genesis block.
2012-10-24 16:44:52 +02:00
Matt Corallo
2bfe8dfa25 Let calls to Block.addTransaction override sanity checks in testing 2012-10-24 16:44:52 +02:00
Mike Hearn
dd47862829 Minor reformatting 2012-10-24 16:44:52 +02:00
Matt Corallo
c5f8135f60 Allow coinbase value to be specified in createNextBlock for testing 2012-10-24 16:44:52 +02:00
Matt Corallo
a1124e696b Verify MAX_BLOCK_SIZE in verifyTransactions(). 2012-10-24 16:44:51 +02:00
Mike Hearn
7eae91ea47 Remove temp announcement listener in PeerGroup.broadcastTransaction once done. 2012-10-08 18:26:28 +02:00
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