Commit Graph

1140 Commits

Author SHA1 Message Date
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
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
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
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
Andreas Schildbach
7b24a72e45 Implement ScriptChunk.toString() by extracting relevant parts from Script.toString(). 2014-05-27 10:03:56 +02:00
Piotr Włodarek
9c8d2cc600 Renamed proofOfWorkLimit to maxTarget along with get/set and minor refactorings.
* proofOfWorkLimit renamed to maxTarget to get it more inline with commonly used terminology (wiki, etc.)
* some misleading local variables renamed from 'difficulty' to 'target'
2014-05-25 11:44:52 +02:00
Piotr Włodarek
c08c68fc5e Dealt with several compiler notices by verifying and then fixing or suppressing. Reduces compilation output noise. 2014-05-25 11:43:36 +02:00
Piotr Włodarek
cc6090af88 Fixed type references in javadoc to avoid IntelliJ error reports on rebuild. 2014-05-25 11:43:01 +02:00
Piotr Włodarek
b32d0cce17 Improved consistency and formal correctness of all existing .equals methods to meet IntelliJ's convention.
* added null handling so equals methods return false for null argument
* replaced instanceof with getClass to force strict type equality
* added @Override for equals and hashCode where missing
* minor refactorings in equals methods to simplify and improve consistency
* added missing hashCode for ListMessage based on equals definition

Things that HAVE NOT changed:

* set of attributes used for equality checking
* hashCode calculation (except for added hashCode in ListMessage)
* correlation between equals and hashCode
* no new equals methods added
2014-05-22 20:50:42 +02:00
Andreas Schildbach
ff8d76cf7e Include PUSHDATA opcode in Script.toString(). Also, smallNums are printed in their decoded form. 2014-05-22 13:03:32 +02:00
Andreas Schildbach
c236ae418f Keep opcode in ScriptChunk representation of scripts. The goal is to know how data was pushed and be able to apply malleability rules. All unit-tests pass. 2014-05-22 13:03:32 +02:00
Mike Hearn
b47995ed97 Wallet: throw more appropriate exception types during completion.
Resolves issue 560.
2014-05-21 19:38:12 +02:00
Mike Hearn
028a1cca69 Upgrade scrypt library. 2014-05-21 19:25:38 +02:00
Mike Hearn
a07a810ed8 Don't crash if there's no logging handler installed. 2014-05-21 19:25:29 +02:00
Mike Hearn
467124a2b3 Wallet: keep risk dropped txns around in RAM and don't miss them when a Bloom filtered block includes them. Resolves issue 545. 2014-05-21 16:50:17 +02:00
Mike Hearn
ed2948cef1 Correctness fix: compare nBits directly not in BigInteger form as nBits has multiple non-canonical encodings. 2014-05-21 15:09:52 +02:00
Andreas Schildbach
4a5854a599 Reformat log messages in DnsDiscovery and add one log message for the success case, to make more clear what's going on.
Also, rename hostNames to dnsSeeds as this name is more speaking for itself, and is used in other places as well.
2014-05-21 13:22:04 +02:00
Mike Hearn
ee2a91010e PeerGroup: return the peers that match the requested protocol version in waitForPeersOfVersion. 2014-05-20 17:51:45 +02:00
Mike Hearn
dfb3a763ce Add some convenience methods to Transaction for signing. 2014-05-20 17:20:11 +02:00
Mike Hearn
1fe0e7fa6c Add some JavaDocs to FakeTxBuilder 2014-05-20 17:20:11 +02:00
Mike Hearn
2548076fa6 Refactor TestWithPeerGroup a bit to make it more reusable in apps. 2014-05-20 17:20:11 +02:00
Mike Hearn
9e5a06120a Add a PeerGroup.waitForPeersOfVersion API and add unit tests for the waitForPeers* methods. 2014-05-20 14:01:55 +02:00
Mike Hearn
f378bb3a43 Add Addy's main net DNS seed and remove Matt's testnet seed as it doesn't work properly. 2014-05-19 16:17:30 +02:00
Piotr Włodarek
f7e982cee1 Minor refactorings in VersionedChecksummedBytes. 2014-05-18 23:19:55 +02:00
Piotr Włodarek
e91cc443e9 Updated comment for WalletAppKit class to reflect deprecation of start and startAndWait in Guava. 2014-05-18 22:30:22 +02:00
Piotr Włodarek
cd4219ccb1 Fixed comment for Wallet.sendCoins regarding MIN_NONDUST_OUTPUT. 2014-05-18 22:30:09 +02:00
Mike Hearn
443b62481d BloomFilter: set a lower bound on nHashFuncs of 1: there must always be at least one function. Thanks to Kalpesh Parmar for debugging this.
Static import Math for shorter more readable code.
2014-05-13 13:06:48 +02:00
Mike Hearn
cbd91c7ea1 Fixes to tagging, thanks to Andreas for the review.
- Wallet now forces immediate autosave when a tag is set.
- TaggableObject javadocs s/wallet/object/
2014-05-13 13:00:01 +02:00
Mike Hearn
acebe8e3d2 Tighten scope of the FileInputStream in WalletAppKit to avoid lock collisions on Windows. Resolves issue 556. 2014-05-13 12:57:02 +02:00
Mike Hearn
408bca3433 Do tags lazily as was supposed to happen. 2014-05-09 14:56:26 +02:00
Mike Hearn
d68b3b5108 Update script JSON files with latest changes from Peter Todd. 2014-05-09 14:18:13 +02:00
Mike Hearn
268dfe297f Add a simple API that lets you tag wallets with arbitrary string->byte[] pairs. 2014-05-08 20:13:09 +02:00
Mike Hearn
c277dc7e4e Require PeerFilterProviders to expose a lock, and use them to avoid a race that occurs during Bloom filter construction.
It's possible in some uses to cause the Wallet to create two batches of keys one after the other, but independently such that the second batch of keys is derived (with HDWs) whilst the filter is being recalculated from the first. This in turn could race with filter calculation and cause asserts or miscalculated filters.
2014-05-08 00:33:01 +02:00