3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-13 02:35:52 +00:00

3136 Commits

Author SHA1 Message Date
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
e3409e5d6d Merge script_valid.json and script_invalid.json into one script_tests.json.
This also synchs script_tests.json to Bitcoin Core's version as of dde46d3ae1de18700e089bc1861cf1e18649dc5d, minus some of the newer 'invalid' tests which we can't handle yet.

We also need to check 'invalid' tests more specificly for the expected error; the current behaviour mimics how dataDrivenInvalidScripts() used to work.

The buildCreditingTransaction() and buildSpendingTransaction() methods were written by Nicola Atzei.
2017-07-05 14:33:03 +02:00
Jean-Pierre Rupp
083136e9e8 TransactionTest: Reformat some lengthy method invocations. 2017-07-01 16:42:23 +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
Andreas Schildbach
1692cd973e Update wallet-template to Guava 22.0-android too. 2017-06-23 11:49:55 +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
ce07ceabc4 BIP32Test: New test vector, see https://github.com/bitcoin/bips/pull/497 2017-03-06 10:14:18 +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
Giuseppe Raveduto
1fd8b90f42 Fix SendRequest package in forwarding.js. 2017-02-16 01:39:26 +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
Andreas Schildbach
380abd0d52 PeerAddress: Remove mostly unused setters to make the class more immutable. 2017-01-10 11:51:37 +01:00
Andreas Schildbach
88fec4e937 VersionMessage: Use Guava InetAddresses for localhost address. 2017-01-10 11:28:59 +01:00
Andreas Schildbach
9cbc45aeea PeerAddress: Require NetworkParameters in constructors. 2017-01-10 11:23:25 +01:00
Andreas Schildbach
3177bd52a2 If possible, use generic type inference for constructing objects. 2017-01-09 18:03:07 +01:00
Andreas Schildbach
a06956c6e1 Update core to Java7. We still need to target the Java6 API though, in order to stay compatible with Android. 2017-01-09 18:02:20 +01:00
Giuseppe Raveduto
6669d9032c Fix the "TypeError: Java.extend needs at least one type argument" in the forwarding.js example (wrong package). 2016-12-01 13:25:49 +01:00
Andreas Schildbach
ea4a3ed67a Remove tor.js from examples as Tor support was removed from bitcoinj recently. 2016-12-01 13:22:05 +01:00
Andreas Schildbach
09b8ae4adf Update seeds for mainnet and testnet. Seeds are copied from Bitcoin Core 0.13.1. 2016-12-01 12:43:54 +01:00
Andreas Schildbach
2cda567a53 Update to Bouncy/Spongy Castle 1.52. 2016-11-27 11:02:40 +01:00
Jarl Fransson
22beb447d1 WalletProtobufSerializer: Add property to require all found wallet extensions to be known when loading wallet.
Corrected copy pasted text, add warning when ignoring extension due to parsing failure.
2016-11-27 10:59:19 +01:00
Jarl Fransson
072106a53b Improve exception logging for some general exception handlers. 2016-11-27 10:57:25 +01:00
Jarl Fransson
814248a966 Context: Make members final. Make event horizon default value 100 into static constant.
This change makes all fields in a Context instance final to simplify and make the rules clearer. The fields are not meant to be updated as the Context object is propagated in different threads as Thread Local Storage. Even if that mechanism gets removed later, different set of values (in the same process) should be represented as different Context instances.
2016-11-27 10:50:28 +01:00
Jarl Fransson
1a274ce7a1 SPVBlockStore: Make getFileSize() a static method for computing size before creating/outside instance. 2016-11-27 10:43:57 +01:00
Jan Vornberger
3d06dd9802 Add setter for wallet factory to WalletAppKit. 2016-11-27 10:40:24 +01:00
Andreas Schildbach
7e609a2409 Remove Orchid forked subproject and support for connecting via Tor. 2016-11-25 23:14:39 +01:00
Andreas Schildbach
ba6e65f091 TransactionConfidence: Print source to toString(). 2016-11-23 18:57:49 +01:00
Andreas Schildbach
34e33a194b Monetary: Add parseCoinInexact() and parseFiatInexact() variants that will cut the amount to the smallest unit. 2016-10-30 13:04:39 +01:00
Andreas Schildbach
9c72c86ed1 Monetary: Tiny optimization in parseCoin()/parseFiat(). 2016-10-30 13:04:39 +01:00
Daniel James
1746be6e10 ECKey: Fix violation of equals/hashCode contract.
ECKey violates the equals/hashCode contract for
Java objects. Objects that are equivalent via
the equals method, _must_ have the same hash code.

This is not the case for ECKeys when comparing
the compressed and uncompressed forms of a public key.
The implementation of the `equals` method defines
these objects to be equivalent, but the hashCode
method defined them to be distinct!

Original implementation comes from commit
640db52cf48416db8e2b24b502b3775243ad5162
which contains this bug. [1]

Note that the comment identifies the correct intent:

> Public keys are random already so we can just use a part of them as the hashcode. Read from the start to
> avoid picking up the type code (compressed vs uncompressed) which is tacked on the end.

But the second sentence is incorrect. The first byte (index 0) is the type code
(compressed vs. uncompressed), not “the end”.

The code has since been refactored in commit
9219d8a9b5714cf4e65dc046c70930c86416e65d
but the implementation is effectively
identical. [2]

The fix is simple: use the most-significant four
bytes of the X-coordinate of the public key.

[1](640db52cf4 (diff-b59ef8be77b9148b27a14be59762c0c5R353))
[2](9219d8a9b5 (diff-1849449aac05f7e59de7ebd56efd7f43R1201))
2016-10-30 12:59:47 +01:00
Andreas Schildbach
2f14c76fb8 Wallet.completeTx: Harmonize logging of requested and effective fee/fee rate. 2016-10-27 22:34:50 +02:00
Andreas Schildbach
9cfa0a35a1 Fiat: Fix comments. 2016-10-22 18:37:02 +02:00
Andreas Schildbach
7a1613a48d DeterministicKeyChain: Inline addToBasicChain() method. 2016-09-30 17:45:37 +02:00