3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-12 02:05:53 +00:00

2523 Commits

Author SHA1 Message Date
Andreas Schildbach
34e8bc217a build.gradle: Configure Eclipse plugin. 2019-02-14 23:03:24 +01:00
Andreas Schildbach
0bd65ea999 If possible, use generic type inference for constructing objects. 2019-02-14 20:34:55 +01:00
Andreas Schildbach
5274855f2b Replace some of my copyright statements by the generic statement. 2019-02-14 20:25:38 +01:00
Andreas Schildbach
fffa4c06fe ScriptPattern: Rename the matchers and extraction helpers for "pay to" script types into an abbreviated form. 2019-02-14 20:17:47 +01:00
Andreas Schildbach
05efa7e69e KeyChainGroup, Wallet: Implement the upgrade path Basic --> P2PKH --> P2WPKH. 2019-02-14 14:22:12 +01:00
Andreas Schildbach
3c73f5e8a1 KeyChainGroup: Introduce concept of multiple active keychains.
The newest/last active keychain is the default. Almost all of this class only works on the default active keychain.
All other active keychains are meant as fallback for if a sender doesn't understand a certain new script type.
New P2WPKH KeyChainGroups are created with a P2PKH fallback chain. This will likely go away in future as P2WPKH
and Bech32 are becoming the norm.
2019-02-13 23:40:20 +01:00
Andreas Schildbach
16b53836b8 Wallet, KeyChainGroup: Remove implicit creation and activation of a new chain.
The was likely the remains of lazy creation of wallets. Lazy creation wasn't of much use,
since wallets are usually accessed the moment after they're created. And also we introduced
a second "laziness" by only deriving a couple of keys per chain, deferring the hard work
for when bloom filtering is used.
2019-02-13 22:18:28 +01:00
Andreas Schildbach
eb15ac07d3 Wallet: Remove implicit upgrade from a basic to a deterministic wallet.
It never worked for encrypted wallets anyways, and encrypted wallets should be
the the norm. Use Wallet.isDeterministicUpgradeRequired() to find out if your
wallet should be upgraded and invoke Wallet.upgradeToDeterministic() when the
time is right.
2019-02-13 21:57:57 +01:00
Andreas Schildbach
2bdc594468 SPVBlockStoreTest: Add a performance test. 2019-02-13 21:50:32 +01:00
Andreas Schildbach
4f5b2f2660 KeyChainGroup: Remove ability to change default lookaheadSize and lookaheadThreshold after construction.
Use Builder.lookaheadSize() and Builder.lookaheadThreshold() if you want to change the defaults, or
manage lookahead on DeterministicKeyChains directly.
2019-02-13 16:26:57 +01:00
Andreas Schildbach
ba4dacae84 UnitTestParams: Define human-readable part for Bech32 addresses. 2019-02-13 14:25:28 +01:00
Andreas Schildbach
4789ea84a5 DeterministicSeed: Make encryptedSeed immutable. 2019-02-13 14:15:22 +01:00
Andreas Schildbach
02b0907535 DeterministicSeed: Don't print private data in toString() by default. 2019-02-13 14:10:22 +01:00
Andreas Schildbach
bfe2a195b6 Receive to and send from native segwit addresses
- Hierarchical-deterministic derivation of native segwit addresses.
- Receive payments to native segwit addresses.
- Spend and sign payments from native segwit addresses.
- Watch-only wallets with native segwit addresses (zpub/vpub).
- WalletAppKit, Wallet-tool and Wallet-template are taught to deal with segwit-enabled wallets.

Be aware this adds a new field in the wallet protobuf: output_script_type in Key, which keeps track
of the script type of DeterministicKeyChains. Protobufs will be migrated; old DeterministicKeyChains
are assumed to be of type P2PKH.

Includes some code by Fabrice Drouin.
2019-02-11 16:48:37 +01:00
Andreas Schildbach
691a3b1de8 KeyChainGroup: Remove most constructors. Those that remain are considered an unstable API.
Migrate all use of constructors to use a builder instead.
2019-02-11 10:19:38 +01:00
ueno
d1ec4b5901 RegTestParams: Fix Bech32 human-readable part. 2019-02-10 17:42:00 +01:00
Andreas Schildbach
dceb2a4261 VersionMessage: Add support for BIP111 (NODE_BLOOM service bit). 2019-02-07 19:47:32 +01:00
Andreas Schildbach
d35583236a Wallet: Add static constructor createBasic() which creates a wallet with just a basic keychain, and no key derivation. 2019-02-07 19:45:49 +01:00
Andreas Schildbach
6278dc39b1 KeyChainGroup: Inline method makeP2SHOutputScript(). 2019-02-06 15:33:35 +01:00
Andreas Schildbach
be4245d2dd Peer: When using GetData for transactions, request witnesses if available. 2019-02-06 02:16:00 +01:00
Andreas Schildbach
53a63c43bb Transaction: Add getTxId() and getWTxId(); deprecate getHash() and getHashAsString(). 2019-02-06 02:15:11 +01:00
Andreas Schildbach
2d943838dd ListMessage: Implement toString(). 2019-02-06 01:06:19 +01:00
Andreas Schildbach
50df97c98a Transaction: Prettify toString() once again. 2019-02-06 01:02:34 +01:00
Andreas Schildbach
415686e001 TransactionInput: Add getIndex() helper. 2019-02-04 19:42:17 +01:00
Andreas Schildbach
480150f87f SegwitAddress: Allow only compressed keys in fromKey(). 2019-02-04 11:56:29 +01:00
Andreas Schildbach
4c60984e14 ECKey: Clearly mark a key as uncompressed in toString(). 2019-02-04 11:53:57 +01:00
Jon Griffiths
3403fc52c6 DownloadProgressTracker: Fix behaviour when download is done.
Currently progress() can be called after doneDownload() which should not
happen. Also make sure that we call progress() with 100% progress before we
call doneDownload() - this is in case any existing users have given up on
downDownload() being called at the right time and instead use 100% progress
as their signal that downloading is complete.
2019-02-04 02:10:29 +01:00
Andreas Schildbach
45e25167cd ECKey: Include human readable creationTime in toString(). 2019-02-03 17:32:53 +01:00
Andreas Schildbach
58ca1d1d8c BasicKeyChain: Extract toString() from KeyChainGroup. 2019-02-03 16:49:23 +01:00
Andreas Schildbach
3fea6428ef Wallet: Fix JavaDoc for setKeyRotationTime() and accept null argument to stop key rotation. 2019-02-03 11:42:17 +01:00
Andreas Schildbach
09deb02aec MonetaryFormatTest, BtcFormatTest: Disable locale-sensitve tests that surface non-determinism between OpenJDK versions. 2019-02-03 02:35:41 +01:00
Andreas Schildbach
4fd144d71d Refresh bundled checkpoints. 2019-02-02 22:30:06 +01:00
Andreas Schildbach
7ddd5a49dd ScriptBuilder: Rename createOutputScript(ECKey) to createP2PKOutputScript and add a byte[] variant. 2019-02-02 21:49:33 +01:00
Andreas Schildbach
2dd2acd4a8 DeterministicKeyChain, MarriedKeyChain: Remove most constructors and static constructors. Those that remain are considered an unstable API.
Migrate all use of constructors to use the builders instead.
2019-02-02 21:46:44 +01:00
Andreas Schildbach
16c7d03e1f Script: Include stack dump in exception messages in correctlySpends(). 2019-02-02 16:36:25 +01:00
Andreas Schildbach
c8caff20cd Transaction: Rename parameters redeemScript and connectedScript to scriptCode in witness signature methods. 2019-02-02 16:34:32 +01:00
Andreas Schildbach
a5fd9c6848 KeyBag: Rename method findKeyFromPubHash() to findKeyFromPubKeyHash(). 2019-02-01 18:02:20 +01:00
Andreas Schildbach
53908d8939 KeyBag, TransactionBag: Rename parameters pubkey to pubKey, pubkeyHash to pubKeyHash. 2019-02-01 18:01:45 +01:00
Andreas Schildbach
01daaf5815 TransactionOutput: Fix incomplete isMine() implementation. 2019-02-01 17:13:08 +01:00
Andreas Schildbach
492b3c7f8d Wallet: Add findKeyFromAddress() convenience method. 2019-02-01 17:13:08 +01:00
Andreas Schildbach
68c5a622d2 Wallet: Add isAddressMine() convenience method. 2019-02-01 16:11:17 +01:00
Andreas Schildbach
e3e4e3f32a PeerGroup: Fix NullPointerException in handleNewPeer() if no download peer could be selected. 2019-02-01 02:32:58 +01:00
Andreas Schildbach
5d6ae4082b PeerGroup: Fix IndexOutOfBoundsException if no peer fits the criteria when selecting the download peer. 2019-02-01 02:30:26 +01:00
Andreas Schildbach
efaae76fa9 PeerGroup: Log last download peer on shutdown. 2019-02-01 02:27:27 +01:00
Andreas Schildbach
0230a25b23 Peer: Don't refresh the filters every 25.000 blocks.
Reasons:
- The implementation was bugged, because it overwrites the server filter with an outdated (not
  updated according to NODE_UPDATE_* flags) filter, potentially causing missing transactions.
- Refreshing a filter in-flight has privacy issues.
- According to the comment it isn't even needed any more, due to false positive rate tracking.
2019-01-31 23:55:19 +01:00
Andreas Schildbach
2254bd9777 Peer: Also connect to peers which serve only the last two days worth of blocks, but download only from those that have the full blockchain.
This implements BIP159.
2019-01-31 21:38:33 +01:00
Andreas Schildbach
0c2a9e646c Peer: Implement proper toString(). 2019-01-31 21:35:25 +01:00
Andreas Schildbach
8ca8c64824 TransactionTest: Comment hex fields in testWitnessSignature*() tests. 2019-01-30 21:31:41 +01:00
Andreas Schildbach
f268a23898 BloomFilter: Add insert(TransactionOutPoint) variant. 2019-01-30 21:28:38 +01:00
Andreas Schildbach
389fb1f78c BloomFilter: Include nFlags in toString(). 2019-01-30 21:25:10 +01:00