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
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
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
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
Mike Hearn
fbbdbb576e
Minor reformattings + more javadocs + rename signRequestPki to just signRequest as there are no other signing methods at the moment.
2014-05-05 11:39:07 +02:00
Andreas Schildbach
cdfec498a4
Extract methods for creating and parsing payment requests, payment messages and payment acks, as well as Ack data class. Expose more payment request data from PaymentSession. Add unit tests for roundtripping all messages.
2014-05-05 11:26:25 +02:00
Andreas Schildbach
bd49cd4027
Rename misnamed PaymentRequestException to PaymentProtocolException. It's used for payment messages and maybe payment acks as well.
2014-05-05 11:26:25 +02:00
Mike Hearn
4df728a7d9
Wallet: add output shuffling (a second time - where did it go?!). It's optional for unit testing.
2014-04-30 23:47:24 +02:00
Mike Hearn
c8ffc1eaee
PaymentSession: Expose params and throw if transactions don't match requested params.
...
Resolves issue 551.
2014-04-30 22:19:39 +02:00
Mike Hearn
6e999c6054
Simplify the MockTransactionBroadcaster a bit and update the docs.
2014-04-23 00:24:48 +02:00
Mike Hearn
e1d6707626
Move some testing utilities to a new testing subpackage and rename TextUtils to reflect what it actually does.
2014-04-22 16:48:49 +02:00
Andreas Schildbach
b0fa5435a2
Fix parsing of empty labels and messages, and parsing of labels and messages with an unescaped equals sign in their value.
2014-04-22 14:21:11 +02:00
Mike Hearn
b3162cbc17
Fix a crash that can occur if a peer reports a chain height of zero (this is a protocol violation but such crashes were seen in the wild).
2014-04-22 14:03:10 +02:00
Andreas Schildbach
2708df58b3
Adjust MIN_NONDUST_OUTPUT down to 546 only for risk analysis. This is required because we start seeing more and more transactions using the new fee rules introduced with Bitcoin Core 0.9.
2014-04-18 11:57:36 +02:00
Mike Hearn
5c8cf6bc38
Deprecate Script.isSentToP2SH() as it did the same thing as isPayToScriptHash.
2014-04-15 17:28:55 +02:00
Andreas Schildbach
40d60306fa
Unit tests for signing and verifying both valid and expired payment requests.
2014-04-14 16:40:39 +02:00
Andreas Schildbach
4502c40e59
Move verification of payment requests into new PaymentProtocol class.
2014-04-14 16:40:39 +02:00
Andreas Schildbach
f13c437a54
Fix X509UtilsTest ended up in wrong package.
2014-04-14 16:35:39 +02:00
Jakob Stuber
188cf6081d
Add support for creating multisig inputs scripts that redeem P2SH outputs
2014-04-14 16:34:24 +02:00
Andreas Schildbach
6087e43377
Upgrade to Guava 16.0.1.
...
Resolves issue 375.
2014-04-08 16:49:09 +02:00
Mike Hearn
feba332e6e
Upgrade to Bouncy Castle 1.50. Patch from Peter Dettman. Resolves issue 497.
2014-04-08 16:28:03 +02:00
Mike Hearn
e372aa4430
Implement equals/hashCode for ECDSA/TransactionSignature, and make them immutable.
...
Change the canonicalisation method to return a canonicalised copy, if required, and change the name to force users to notice that it's no longer mutating the object.
Resolves issue 544.
2014-04-07 18:41:40 +02:00
Mike Hearn
8e61a2027f
Move X509Utils/TrustStoreLoader, add JavaDocs, and add back a parameter to allow location data to be included in the display name.
2014-04-07 13:27:49 +02:00
Andreas Schildbach
e7eec49671
Extract getDisplayNameFromCertificate() into new X509Utils class. Also joins PkiVerificationData.name and .orgName into one .displayName. Adds tests using client/smime certificates of mine.
2014-04-07 12:07:36 +02:00
Andreas Schildbach
e640d1eec3
Cheap test to see if an input stream is a wallet.
2014-04-05 23:14:35 +02:00
Mike Hearn
918ceb8f55
Fix unit test broken by less aggressive backoff time.
2014-04-04 15:23:56 +02:00
Mike Hearn
150e9fb7df
More mock clock conversions, to avoid failures when running test cases independently.
...
Probably we should be injecting a mock Clock class so it goes away at the end of each test, but this would complicate the API somewhat.
2014-04-04 15:06:45 +02:00
Mora Zyx
b720a868a7
Replace usages of currentTimeMillis where result is / 1000 with currentTimeSeconds
2014-03-29 14:41:44 +01:00
Andreas Schildbach
2cbdf324ab
Fix race of mock clock with current time if tests are all run sequentially. This commit requires you to use one of the setMockClock() variants before being able to roll it.
2014-03-29 12:01:24 +01:00
Andreas Schildbach
b303d77029
Allow shutting down wallet auto-saving.
2014-03-26 13:56:43 +01:00
Mike Hearn
822c9011b2
ECKey: fix bug where creation time was lost when encrypting/decrypting.
2014-03-20 14:28:04 +01:00
Mike Hearn
e397928ec3
ECKey: preserve compression state when deserializing from ASN.1.
...
Resolves issue 528.
2014-03-17 17:42:56 +01:00
Mike Hearn
a49f643cdc
Wallet: disallow adding of keys that don't match the wallet's encryption state.
2014-03-17 16:30:57 +01:00
Andreas Schildbach
b17533f8fb
Add script test to prove that OP_0 evaluates as the empty vector, rather than [0]. Also adds debug output in case an script_invalid.json test fails.
2014-03-17 16:14:15 +01:00
Pavol Rusnak
8229daf38d
BIP-0039: just adapt number of rounds and test vectors
2014-03-10 14:14:16 +01:00
Pavol Rusnak
aa499dfaf8
Revert "BIP-0039 multiple version support."
...
This reverts commit 1a3c3be665f8ac0d5cefbbf2a0be84d23c9221f8.
2014-03-10 14:14:15 +01:00
Peter Todd
5a8b99b64d
Update BIP URLs to new github repo
2014-03-02 15:01:44 -05:00
Mike Hearn
b52faae013
PeerGroup: fix a regression that stopped Bloom filters being sent when a key is added, and add a unit test covering that behaviour.
...
Resolves issue 524.
2014-02-23 13:12:26 +01:00
Andreas Schildbach
295e8a154d
Fix handling of defaults when parsing the payment message. Bitpay is leaving out the payment details version which was handled incorrectly. Adds a testcase for the defaults.
2014-02-21 18:19:04 +05:30
Mike Hearn
ce61bd211d
Wallet: recursively kill transactions that depend on dead transactions.
...
Resolves issue 186.
2014-02-21 17:30:45 +05:30
Andreas Schildbach
e7ea8483e4
Add method to clean up the wallet.
...
Currently, it just removes risky pending transaction from the wallet and only if their outputs have not been spent. Includes unit-tests by Miron Cuperman.
2014-02-20 22:19:17 +01:00
Matt Corallo
af1fdd4a14
Add isStandard risk analysis.
...
This is currently only to deal with recent spam, especially dust sybil spam. Includes an unit-test by Andreas Schildbach.
2014-02-20 22:19:17 +01:00
Andreas Schildbach
5ca6f13195
Replace usage of BigInteger.compareTo(BigInteger.ZERO) with BigInteger.signum() as it's easier to read and more performant. Passes all unit tests.
2014-02-08 15:00:43 +01:00
Mike Hearn
3c86785a89
Payment protocol: Expose a friendly/display name for validating CA
2014-02-07 18:12:18 +01:00
Erik Tierney
59a18ab43f
Add ability to optionally use a schema name in the Postgres block store.
...
Add a test to make sure things work when we set a schema name.
2014-02-07 17:21:26 +01:00
Mike Hearn
f4def39f40
H2 is now being exercised more thoroughly and was leaving test db files hanging around that would cause the next run to fail, fix.
...
Rename method/clean up a bit.
2014-01-31 18:49:58 +01:00
Alex Taylor
c10e029384
Postgres block store, with ability to calculate address balances.
2014-01-31 14:23:40 +01:00