Commit graph

3520 commits

Author SHA1 Message Date
Andreas Schildbach
80ff250cfc Remove bitcoinj logos (and the misc folder).
We have copies in the webpage repository where they belong.
2019-08-09 17:08:01 +02:00
Andreas Schildbach
5fb2b44d47 PrivateKeys: Send coins before stopping the PeerGroup. 2019-08-09 11:29:14 +02:00
Sean Gilligan
1394f91d61 Update slf4j to 1.7.27. 2019-08-08 09:43:56 +02:00
Andreas Schildbach
726c7291ac Wallet: Remove global coinSelector and allowSpendingUnconfirmedTransactions().
Coin selection is a per SendRequest, per createSend() or per getBalance() call affair.
Having it wallet-global can lead to race conditions, as sometimes experienced in the
WalletTest unit tests.
2019-07-26 20:30:27 +02:00
Sean Gilligan
a8be47b2d6 .gitlab-ci.yml: Add basic configuration for GitLab continuous integration. 2019-07-26 20:03:31 +02:00
Andreas Schildbach
cee5264ab9 build.gradle: Specify javadoc encodings. 2019-07-26 17:14:37 +02:00
Sean Gilligan
951d18b9a7 Update slf4j to 1.7.26. 2019-07-26 10:43:57 +02:00
Andreas Schildbach
a49f681d24 KeyCrypterScrypt: Print all Scrypt parameters, not only N. 2019-07-20 17:28:53 +02:00
Sean Gilligan
7d68fb7076 HDUtilsTest: Move parse and format HDPath tests to HDPathTest. 2019-07-20 11:05:43 +02:00
Sean Gilligan
86c461b7e1 AppDataDirectoryTest: Fix throwsIOExceptionIfPathNotFound() on macOS.
“:” is not an invalid character, but “\0” is.
2019-07-20 10:55:11 +02:00
Andreas Schildbach
1e55d72dc3 SendRequest: Add allowUnconfirmed() convenience method. 2019-07-15 12:26:14 +02:00
Andreas Schildbach
161bd68dd2 DefaultCoinSelector: Make it a singleton. 2019-07-15 12:07:27 +02:00
Andreas Schildbach
d67f060e27 Remove Micropayment Channels.
Now that HTLC-based bi-directional payment channels are state of the art, nobody will ever use the old style.
2019-07-15 11:05:14 +02:00
Sean Gilligan
e5a6808fd3 HDPath: M() and m() factory methods
Refactor existing of() factory methods to M() (for public key) and
add m() methods for private keys. Also add varargs methods.
2019-07-10 15:46:21 +02:00
Sean Gilligan
823a03db77 Move HDPath methods from HDUtils to HDPath
All HDPath-related methods in HDUtils are now deprecated and delegate
to HDPath. HDPath now contains parsePath code.
2019-07-07 10:13:26 +02:00
Sean Gilligan
b59add47a7 DeterministicKey: toString() output of creation time now corresponds with
getCreationTimeSeconds(), but we indicate if the creation time was inherited
from the parent.
2019-07-05 22:55:31 +02:00
Sean Gilligan
855c061c0c HDPath: Use varargs for extend() and add tests. 2019-07-05 22:40:38 +02:00
Tim Strasser
734fc9fdd0 AppDataDirectoryTest: Implement a test for case of invalid directory name 2019-07-05 12:12:48 +02:00
Sean Gilligan
a9dd62e34e Replace deprecated Guava Maps.newHashMap()
For JDK7+ `new` with the diamond syntax is preferred.
2019-07-05 12:08:14 +02:00
Sean Gilligan
ba922a910a Fix NPE in o.b.c.Utils runtime and os detection
If getProperty returns null calling toLowerCase results in NPE. Instead
we’ll use a default value and check for .equals(“”) in the following if.
2019-07-02 21:08:27 -07:00
Sean Gilligan
035839fdbf StoredBlock: Mark two constants as private. 2019-06-23 18:20:35 +02:00
Sean Gilligan
b9d88e20ef AbstractBlockChain: Fix typos in JavaDoc. 2019-06-23 18:12:42 +02:00
Sean Gilligan
474700ff50 StoredBlock: Add JavaDoc for constructor. 2019-06-23 18:11:43 +02:00
Sean Gilligan
99b019e5b0 New HDPath type to replace ImmutableList<ChildNumber>. 2019-06-23 14:20:15 +02:00
Sean Gilligan
3c5744a6cb AppDataDirectory: Move from wallettemplate/.utils to core/.utils
This allows usage in both wallettemplate and tools and replaces
similar code in BlockFileLoader.java in core.
Requires minor back-port of Path.of() functionality from JDK11.
2019-06-20 10:09:21 +02:00
Sean Gilligan
d446951ceb AppDataDirectory: Use lower-case appName for data dir on Windows/Linux/Unix. 2019-06-19 21:27:01 +02:00
Sean Gilligan
ebc59d06c6 MissingSigResolutionSigner: Make the missingSigMode member private and final. 2019-06-17 10:37:33 +02:00
Sean Gilligan
ea26e6bd26 StoredBlock: Make member fields final. 2019-06-12 11:44:40 +02:00
Cameron MacKeen
42cc626717 Transaction: Fix typos in JavaDoc. 2019-06-04 12:11:20 +02:00
Sean Gilligan
806afa0441 Replace Guava newArrayList()/newLinkedList() with direct call to the JDK 7 constructor.
This is recommended by deprecation comment in Guava.
2019-06-01 13:58:11 +02:00
Andreas Schildbach
05ab09b40b ECKey: Fix JavaDoc encoding error on Windows. 2019-05-30 09:10:06 +02:00
Andreas Schildbach
18f9108c6b LegacyAddress: Remove deprecated methods. 2019-05-25 15:39:16 +02:00
Premek
10607fb9f5 AbstractBlockChain: Try connecting orphans more often in add().
This fixes a memory leak.
2019-05-25 15:27:13 +02:00
Matthew Leon
56a44661b6 ScriptPattern: Remove redundant opcode check in isSentToMultisig().
The following line has a check that is strictly stronger.
2019-05-24 15:46:04 +02:00
Matthew Leon
b385e9ed2f ScriptPattern: In isSentToMultisig() replace exception flow by conditional. 2019-05-24 15:40:14 +02:00
Matthew Leon
b51922dde7 ScriptPattern: Correct and clarify the JavaDoc on isSentToMultisig() 2019-05-24 15:35:49 +02:00
Matthew Leon
30e21ea3a0 ScriptChunk.decodeOpN: Remove checkState().
The checkState() on ScriptChunk.decodeOpN() was excessively strict: it excluded OP_0. As the method calls Script.decodeFromOpN(), which itself has a check on the passed-in opcode, we simply remove the check entirely.

No code in bitcoinj was calling ScriptChunk.decodeOpN().
2019-05-21 08:51:25 +02:00
Matthew Leon
735b9143d2 Script: Simplify P2SH pushdata check in correctlySpends().
Simplify the check that all P2SH script content is comprised of pushdata operations, and give a clearer error message when this is not the case.
2019-05-20 10:33:40 +02:00
Matthew Leon
5647f48b0d ScriptChunk: Kill startLocationInProgram.
The startLocationInProgram field of ScriptChunk was used as a caching mechanism for storing the location of each ScriptChunk in a Script. This was memory-inefficient, as this integer was only actually used during interpretation of OP_CODESEPARATOR. Furthermore, it was dangerous and inconsistent: the ScriptBuilder methods, for example, do not properly set startLocationInProgram, leading to a potential runtime failure when interpreting ScriptBuilder-constructed Scripts.

Rather than caching each chunk's location, we add a method called size() that efficiently returns the size of a serialized ScriptChunk. During Script interpretation, we use this method to track the program counter.

Additionally, we add an exhaustive test to ensure that size() properly returns the size of a serialized ScriptChunk.

This will break any code that relied on ScriptChunk.getStartLocationInProgram().
2019-05-19 20:01:06 +02:00
Matthew Leon
0afaaad79a ScriptChunk: Fix IllegalArgumentException in toString() for invalid chunks.
Also see https://github.com/bitcoinj/bitcoinj/issues/1860
2019-05-19 19:51:26 +02:00
Matthew Leon
03f9e94824 ScriptOpCodes: Accept OP_FALSE and OP_TRUE in getOpCode().
Previously, only "OP_0" was accepted as the name for the 0x00 opcode. Similarly, only "OP_1" was accepted for 0x51.
2019-05-19 18:57:00 +02:00
Andreas Schildbach
d78ce55ee1 Update OkHttp to 3.12.3. 2019-05-19 10:18:06 +02:00
Andreas Schildbach
1fb770be69 Update protobuf-java to 3.7.1. 2019-05-19 10:03:43 +02:00
Andreas Schildbach
ab2fb2f9cf KeyChainGroup: New CurrentKeyChangeEventListener that fires when a current key and/or address changes.
This also changes wallet-template to make use of the new listener for updating its current address in the UI.
2019-05-19 08:23:39 +02:00
Matthew Leon
4d0987930a ScriptTest: Make some constants private.
These constants haven't been touched in a number of years. Since then, commits have added several private static constants to this test. This confuses the reader, who naturally becomes curious as to why some constants are private while others are not.

This commit renders all of the constants private.
2019-05-19 07:37:18 +02:00
Matthew Leon
cae0b385a4 ScriptChunk: Add missing @Nullable annotations to constructors. 2019-05-17 11:13:55 +02:00
Matthew Leon
30b3435649 ScriptChunkTest: Add an EqualsVerifier test for ScriptChunk. 2019-05-17 11:09:39 +02:00
Matthew Leon
e2e763bd33 ScriptChunk: Fix immutability. 2019-05-17 11:06:50 +02:00
Matthew Leon
67722ff0e8 ScriptOpCodes: Use the Guava BiMap interface to make the relationship between opCodeMap and opCodeNameMap explicit. 2019-05-17 11:00:39 +02:00
Matthew Leon
6aa56dbbe7 Address hierarchy: Add equals() and hashCode() tests. 2019-05-14 08:50:23 +02:00