Commit graph

2225 commits

Author SHA1 Message Date
Andreas Schildbach
850f219607 Basic support for version 2 transactions.
Rather than considering all version 2 transactions risky, we now look more closely if any of its
inputs has a relative lock time. We can't check the relative locks though, because we usually
don't have the spent outputs (to know when they were creted).
2017-08-31 00:04:01 +02:00
Andreas Schildbach
3061734993 Move SEQUENCE_LOCKTIME_* flags from Transaction to TransactionInput. 2017-08-30 18:14:21 +02:00
Andreas Schildbach
9a3006d03c Transaction: Clarify the meaning of the transaction hash in the JavaDoc.
We will soon have multiple kinds of transaction hashes.
2017-08-25 13:06:26 +02:00
Andreas Schildbach
e32feb0aa9 Refresh bundled checkpoints. 2017-08-24 13:06:05 +02:00
Andreas Schildbach
738011a2a4 Peer: Drop Bitcoin Cash peers early, based on service bit 5.
They will fail the difficulty check anyway.
2017-08-22 12:27:07 +02:00
Andreas Schildbach
ff970f6fad VersionMessage: Define service bits a bit differently. 2017-08-22 12:18:56 +02:00
Andreas Schildbach
3ef5f9f2d7 ECKey.decodeFromDER(): Also throws IllegalArgumentException if unexpected class was read.
Fixes a regression that was introduced with commit e5f14e789a.
2017-08-22 12:03:28 +02:00
Andreas Schildbach
9c49fd5692 Peer: Demote logging of alert messages to debug. They're not important any more now that they're deprecated. 2017-08-14 16:07:18 +02:00
Andreas Schildbach
3c9cb34162 Move ScriptException from .core to .script package. 2017-08-14 09:24:18 +02:00
anton
70bef0a129 Add support for "sendheaders" message (BIP130) and use protocol version to 70012.
For now, we're ignoring this message as bitcoinj does not relay blocks.
2017-08-14 09:22:53 +02:00
Andreas Schildbach
ca033e3368 Option to decrypt private keys and seed on the fly if printing a wallet dump of an encrypted wallet. 2017-08-13 15:22:22 +02:00
Andreas Schildbach
49e6af3bd7 Remove some remaining mentions of Tor and Orchid. 2017-08-12 10:14:12 +02:00
Andreas Schildbach
80b966d39f Use protocol version 70002, stating readiness for BIP61 reject messages.
The code for reject messages has been implemented a long time ago, but we never advanced our protocol version.
2017-08-11 19:25:22 +02:00
Bas van Schaik
40c26b58bd HttpDiscovery: Fix resource leak as a result of unclosed GZIPInputStream. 2017-07-29 21:21:16 +02:00
Andreas Schildbach
1381e86ff1 ECKey: Gender-neutralize a comment. 2017-07-27 14:18:48 +02:00
Nicola Atzei
5f95e510ef Fix several javadoc warnings. 2017-07-27 10:35:21 +02:00
zkejid
ab24a70753 Avoid NullPointerException on preallocated exception (which has no message) in productive code.
For more information, see http://jawspeak.com/2010/05/26/hotspot-caused-exceptions-to-lose-their-stack-traces-in-production-and-the-fix/
2017-07-24 17:33:16 +02:00
Nicola Atzei
6b42e477f7 Script: Fix exception handling within isSentToMultiSig() method. 2017-07-24 15:24:11 +02:00
Andreas Schildbach
d982e5fe9d Add mainnet and testnet seeds from Bloq. 2017-07-24 14:21:09 +02:00
Andreas Schildbach
640dda79f3 ECKey: Fix exception nessage of recently introduced check that constructed private key doesn't exceed 32 bytes. 2017-07-23 00:45:19 +02:00
Nicola Atzei
c87da45321 Context: the overloaded constructor calls the most completed one 2017-07-17 11:38:39 +02:00
Nicola Atzei
3cb1f6c6c5 Utils: Add some checks to bigIntegerToBytes(). 2017-07-16 10:32:46 +02:00
Andreas Schildbach
3890219540 ECKey: Check that constructed private key doesn't exceed 32 bytes. 2017-07-12 10:10:21 +02:00
Nicola Atzei
c308d6ef1c Script: Refactor executeScript() to follow Bitcoin Core implementation. 2017-07-12 10:05:32 +02:00
Nicola Atzei
e1760ec001 Scipt: Remove redundant cases of opcodes. 2017-07-12 10:01:02 +02:00
Gitju
106e9363a6 RegTestParams: MAX_TARGET to be created out of 64 hex digits 2017-07-11 18:09:25 +02:00
Nicola Atzei
d8af6b4be7 ScriptError: New error code for use in ScriptException. Script tests use this to assert for specific errors.
This also adds MINIMALDATA tests from Bitcoin Core into script_tests.json.
2017-07-11 18:01:28 +02:00
Nicola Atzei
bb176dab4d Implement the CHECKSEQUENCEVERIFY script operator.
This also adds CSV-related tests from Bitcoin Core into script_tests.json, tx_valid.json and tx_invalid.json.
2017-07-05 18:45:33 +02:00
Andreas Schildbach
3ec862cf99 Transaction.SORT_TX_BY_HEIGHT: Use the Block.BLOCK_HEIGHT_UNKNOWN constant rather than -1. 2017-06-26 17:29:22 +02:00
Andreas Schildbach
e5f14e789a ECDSASignature.decodeFromDER(): Now throws IllegalArgumentException if something with the input bytes is wrong. RuntimeException is bad! 2017-06-26 13:29:21 +02:00
Andreas Schildbach
0eabd240a6 Transaction.SORT_TX_BY_HEIGHT: For transactions not 'building', use -1 height for sorting purposes. 2017-06-25 20:18:37 +02:00
Andreas Schildbach
e3ca8f2d50 Wallet: Make calculateFee() private.
It was likely never meant for public consumption, because it's return type has always been private.
2017-06-25 20:02:22 +02:00
Nicola
eceee6b6dd Script: Fix two exception messages. 2017-06-14 16:38:43 +02:00
Andreas Schildbach
c24ef97ac0 Transaction.toString(): Clearly state if script is missing. 2017-06-02 16:55:40 +02:00
Andreas Schildbach
afc198600a Utils: Inline join(). 2017-06-02 16:55:40 +02:00
Andreas Schildbach
82fb22a884 Transaction: Fix two null pointer access warnings. 2017-06-02 16:22:53 +02:00
Andreas Schildbach
3fb4d6a1a3 Transaction.toString(): Print incomplete transactions, too. 2017-06-02 16:15:08 +02:00
Andreas Schildbach
6841fceabc Transaction.getFee(): Do not determine fee on incomplete transactions. 2017-06-02 15:32:42 +02:00
Andreas Schildbach
e62275d41b Update to Guava 22.0-android. This raises the Java API requirement to 1.7. 2017-05-31 16:37:04 +02:00
Saulius Beinorius
943a139d08 Fix for irrelevant double spend causing protobuf serialization issues
Fixes #1374. Previously, transactions could have spentBy set but the spending transaction
dropped as being irrelevant. This would then be serialized to protobuf but could not be
deserialized.
2017-05-28 10:54:08 +02:00
Andreas Schildbach
9bde092143 Utils: Don't allow passing null into bigIntegerToBytes(). 2017-05-16 19:35:54 +02:00
Andreas Schildbach
35b1028656 ScriptBuilder: Replace redundant code. 2017-04-06 16:41:19 +02:00
Thomas König
b890c9a9a1 ScriptBuilder: Fix number encoding for 16. It must be encoded with smallNum(). 2017-04-06 16:39:54 +02:00
Oscar Guindzberg
e51428dcf6 Add "Recipients pay fees" feature to Wallet.completeTx(). There is a new SendRequest.recipientsPayFees field you can use.
Part of this code was written by @m-sossich.
2017-03-23 21:07:10 +01:00
Andreas Schildbach
7eb6854627 PeerAddress: Fix a constructor was hardcoded to the mainnet port. 2017-03-01 12:29:57 +01:00
Andreas Schildbach
53a71d7379 Transaction: Update DEFAULT_TX_FEE. Fees have risen considerably. 2017-03-01 00:09:01 +01:00
Oscar Guindzberg
4922036ae2 Wallet: Adjust lastCalculatedSize comment. The 1000 byte boundary is no longer used. 2017-02-28 23:52:07 +01:00
Andreas Schildbach
9e72e72ef4 Update to OkHttp 3.6.0. 2017-02-12 17:28:55 +01:00
Andreas Schildbach
b7233f1245 Transaction: Print transaction version to toString(). 2017-02-05 18:42:38 +01:00
Andreas Schildbach
be09b62062 WalletProtobufSerializer: Fix protobuf deserialization of transaction version. 2017-02-05 18:15:27 +01:00