Commit Graph

1670 Commits

Author SHA1 Message Date
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
1ec162f25c Update HDW todo list. 2014-05-29 20:19:33 +02:00
Mike Hearn
1f776c3f19 Add a program that measures confirmation time for a given fee level.
This is a complementary approach to what the estimatefees code for Core does, because Core cannot really measure confirmation time for a fee level if nobody is setting it.
2014-05-29 20:11:17 +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
fc83deb8fd HDW: Update todo list 2014-05-29 20:11:15 +02:00
Mike Hearn
45a1b11b48 WalletTool: add a lookahead flag that lets you control the lookahead size on the receive branch. Update help text to reflect the new flag and the seed flag as well. 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
6951a6bc65 HD Wallets: add back design doc and todo list 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
Mike Hearn
1ff5d05200 HD wallets: add a Wallet.getKeyChainSeed method. 2014-05-29 20:11:13 +02:00
Mike Hearn
5638387d3a HD wallets alpha preview 2014-05-29 20:11:13 +02:00
Andreas Schildbach
780be05260 Save value of inputs when completing transactions and persist it to the wallet protobuf. Determine the fee of a transaction in case we have all the values. 2014-05-29 20:06:22 +02:00
Andreas Schildbach
03e8934576 Update note about regenerating protobuf bindings. 2014-05-29 20:06:22 +02:00
Mike Hearn
b36bb5bff0 Bloom: don't requery mempool if the filter is only being refreshed to force down FP rate. 2014-05-28 23:09:40 +02:00
Mike Hearn
ecbaaf01d6 Fix scrypt library hash. 2014-05-28 19:19:32 +02:00
Mike Hearn
e95fef3504 Bloom bugfix: track false positives in blocks including when the tx was broadcast within the session, and don't print an error from the wallet in this case. Should have no impact beyond more accurate FP rate calculations. 2014-05-28 18:44:43 +02:00
Andreas Schildbach
344be21821 Fix 'shortest possible pushdata' logic for transaction inputs. Also add a testcase. 2014-05-28 15:43:52 +02:00
Andreas Schildbach
8ca8075a7b Convenience ScriptBuilder.addChunk() method can add arbitrary script chunks. 2014-05-28 15:36:53 +02:00
Mike Hearn
8ff52f5217 Payment channels: update example client to reflect API changes. 2014-05-28 13:26:19 +02:00
Andreas Schildbach
9fe8e8ee2b Teach TransactionOutput.toString() to print send-to-pubkey and send-to-multisig types. 2014-05-27 14:50:31 +02:00
Jiri Peinlich
c37423a737 renaming to nonexisting file on Windows
The method fails in case the file does not exists before renaming. canonical.delete() returns false in that case and the method throws an exception.
2014-05-27 13:19:16 +02:00
Mike Hearn
0442448621 Add qertoip to AUTHORS 2014-05-27 13:18:56 +02:00
Andreas Schildbach
ccc3dbd339 Implement standard checks for BIP62 shortest possible data push rules. Also fix ScriptBuilder so it doesn't build longer than necessary data pushes any more. 2014-05-27 11:49:14 +02:00