Piotr Włodarek
a95c2ed826
Minor comments improvements in Message, EmptyMessage and NetworkParameters.
2014-06-02 21:29:04 +08:00
Piotr Włodarek
019f5f846d
Regenerate protobuf bindings. They didn't fully survive our refactorings.
2014-06-02 21:16:51 +08:00
troggy
eae64a5357
Wallet now delegates currentAddress/freshAddress calls to KeychainGroup
...
This way it's possible for KCG to yield P2H addresses in future
2014-06-02 21:15:58 +08:00
Andreas Schildbach
927d8514f5
Rename Coin.NANOCOIN to Coin.MICROCOIN.
2014-06-02 08:11:03 +02:00
Andreas Schildbach
fa63c83888
Fix 'java.math.Coin' in the JavaDocs.
2014-05-31 11:27:19 +02:00
Andreas Schildbach
346e8fb3bf
Access NetworkParameters.MAX_MONEY in a static way.
2014-05-31 11:27:19 +02:00
Andreas Schildbach
39586bf515
Replace or remove remaining misuses of the term 'nanocoin'.
2014-05-30 18:09:36 +02:00
Andreas Schildbach
56ef72f36f
Deprecate Coin.longValue() in favour of accessing Coin.value directly.
2014-05-30 18:09:36 +02:00
Andreas Schildbach
b15dbfb836
Remove unused imports.
2014-05-30 15:33:58 +02:00
Andreas Schildbach
f10fefe2ae
Clear a lot of compiler warnings because of unparameterized types.
2014-05-30 15:33:58 +02:00
Andreas Schildbach
d4c1a1b043
Add missing @Override annotations.
2014-05-30 15:33:58 +02:00
Andreas Schildbach
51c48bb69f
Clean up coin constants and make more use of it.
2014-05-30 15:09:33 +02:00
Andreas Schildbach
938dec7a73
Rename Coin.toNanoCoins(coins, cents) to Coin.valueOf(coins, cents).
2014-05-30 15:09:33 +02:00
Andreas Schildbach
49adaeed16
Rename Coin.toNanoCoin(String) to Coin.parseCoin(String).
2014-05-30 15:09:33 +02:00
Andreas Schildbach
3e846901cb
Remove weird value accessors.
2014-05-30 15:09:33 +02:00
Andreas Schildbach
ee4dec1835
Remove weird constructors.
2014-05-30 15:09:32 +02:00
Andreas Schildbach
48a76a8a03
Clean up Coin API for multiplications and divisions.
2014-05-30 15:09:32 +02:00
Andreas Schildbach
eb81b0c815
Move coin related methods and constants from Utils into Coin.
2014-05-30 15:09:32 +02:00
Andreas Schildbach
e2140c5cf8
Refactor internal coin representation from BigInteger to long.
2014-05-30 15:09:32 +02:00
Andreas Schildbach
022e7c27fe
Wrap coin-ish BigIntegers into Coin class.
2014-05-30 15:09:32 +02:00
troggy
d2e1b14d4c
Wallet: add convenience methods to vend Address objects for currentKey/freshKey
2014-05-29 20:20:44 +02:00
Mike Hearn
c63f5f7553
Fix bugs and misc review comments from Harold Hoyer's key lookahead pull request. Still needed: unit tests.
2014-05-29 20:11:17 +02:00
Harald Hoyer
5726b97f70
HD Wallets: mark the DeterministicKeys as issued, if seen in a Transaction
...
If a Transaction contains a DeterministicKey of our
DeterministicKeyChains, then we should mark this key as issued. This can
happen, when we replay/resync the blockchain or when another device uses
one of our keys.
Signed-off-by: Harald Hoyer <harald@harald-hoyer.de>
2014-05-29 20:11:17 +02:00
Harald Hoyer
534a1e3a5c
HD Wallets: add a threshold for the DeterministicKey lookahead
...
DeterministicKeyChain.maybeLookAhead() would pre-generate a new key, for
every issued key, even if it is only one. If we replay the blockchain
and update the issuedKeys counter, maybeLookAhead() would trigger the
regeneration and resending of the bloom filter for every used key.
This patch adds a threshold, where keys are only pre-generated after
more keys are needed than the value of the threshold.
Signed-off-by: Harald Hoyer <harald@harald-hoyer.de>
2014-05-29 20:11:17 +02:00
Mike Hearn
42bfbb9b1c
Add some Javadocs and clean up the watching key API a tiny bit. Default creation time is now BIP32 standardisation time.
2014-05-29 20:11:17 +02:00
Harald Hoyer
9ff7a91c8c
HD Wallets: let you specify the creation time for a WatchingKey
...
If the creation time for a WatchingKey is known, it should be taken into
account and stored.
Signed-off-by: Harald Hoyer <harald@harald-hoyer.de>
2014-05-29 20:11:17 +02:00
Mike Hearn
960b9d686e
KeyChainGroup: defensive copy of the chains list in the c'tor
2014-05-29 20:11:16 +02:00
Mike Hearn
1628bf6329
WalletAppKit: set max connections to size of set peer addresses so localhost broadcast works.
2014-05-29 20:11:16 +02:00
Mike Hearn
e4af9a673f
Tweaks to allow wallet subclasses to add their own extensions in their c'tors.
2014-05-29 20:11:16 +02:00
Mike Hearn
748ff6fc8e
WalletAppKit: allow control of wallet construction.
2014-05-29 20:11:16 +02:00
Mike Hearn
4504633fd5
ECKey.recoverFromSignature: respect the compressed flag again.
2014-05-29 20:11:16 +02:00
Mike Hearn
d2837e8ea9
Wallet: allow customization of the wallet type that is deserialized. Makes subclassing Wallet more useful.
2014-05-29 20:11:16 +02:00
Mike Hearn
b374ba5108
HDW: Fix a decryption bug where we were (again) accidentally relying on padding checks to detect wrong passwords. Check the watching key derives correctly to fix.
2014-05-29 20:11:16 +02:00
Mike Hearn
24e41f01c6
Refactorings.
...
Make a convenience ECKey.decrypt(KeyParameter) that doesn't require the keycrypter to be manually specified, as often (always?) the key knows it already.
Introduce a KeyBag interface that just contains findKeyBy* methods, then make Wallet implement it and change Transaction.signInputs to use it. Take out the encrypted-key specific stuff here: Transaction now requires unencrypted keys. Create a DecryptingKeyBag class that just forwards calls to Wallet and decrypts the returned keys. This decouples the signing code from Wallet a bit.
Should be all API compatible.
2014-05-29 20:11:16 +02:00
Mike Hearn
9ca891c709
Wallet: restrict visibility of the transactions map a bit and tag the others as visible for testing. This should get fixed up in a future refactor.
2014-05-29 20:11:16 +02:00
Mike Hearn
1e4f930b70
Wallet: set lookahead size to 5 when using unit test params instead of scattering calls all over the test code.
2014-05-29 20:11:15 +02:00
Mike Hearn
2be8bc1901
ECKey: make compress/decompressPoint use non-deprecated methods and add a note that BC's tracking of compression state is going to go away.
2014-05-29 20:11:15 +02:00
Mike Hearn
a807994b9a
Bump wallet version and add missing check (!) to detect wallets from the future. The absence/incompleteness of this feature had not been noticed before, and it means that old apps will fail to read HD wallets due to the new key enum value rather than a more sensible error (but there's still no chance of an old app accepting an HD wallet, so it should still be safe).
2014-05-29 20:11:15 +02:00
Mike Hearn
c8850c94ae
Bugfix: don't throw away deserialized wallet in WalletAppKit
2014-05-29 20:11:15 +02:00
Mike Hearn
ef95eb3b79
Bugfix: don't crash if getEarliestKeyTime is called on a DKC that wasn't initialized with a seed (i.e. a watching chain)
2014-05-29 20:11:15 +02:00
Mike Hearn
704339fdfb
Bugfix: copy event listeners to new HD chains when created.
2014-05-29 20:11:15 +02:00
Mike Hearn
2ce5c16815
Switch TestWithWallet to be using an HD key by default.
2014-05-29 20:11:15 +02:00
Mike Hearn
d9fa9e4b68
Fix a casting bug in WalletAppKit. Thanks to Kalpesh Parmar.
2014-05-29 20:11:14 +02:00
Mike Hearn
4df59adeb9
Use setMockClock instead of rollMockClock(0) to resolve flaky tests.
2014-05-29 20:11:14 +02:00
Mike Hearn
51b71a4363
HD Wallets: support watching wallets in Wallet and wallet-tool.
...
Also, respect includePrivateKeys flag for the seed in wallet.toString again.
2014-05-29 20:11:14 +02:00
Mike Hearn
c7f7fd29e0
HD Wallets: add a REFUND key purpose and map it to the same branch as RECEIVE_FUNDS for now.
2014-05-29 20:11:14 +02:00
Mike Hearn
dbf504faa0
HD Wallets: add getImportedKeys() method that returns just the basic key chain.
2014-05-29 20:11:14 +02:00
Mike Hearn
534252de49
HD Wallets: bugfix, ensure we don't store private keys that can be rederived.
2014-05-29 20:11:14 +02:00
Mike Hearn
3f9791d86a
HD Wallets: print seed birthday in wallet dump too
2014-05-29 20:11:14 +02:00
Mike Hearn
a1fcca3883
WalletTool: allow creation of a wallet from a given [word] seed.
2014-05-29 20:11:14 +02:00