Commit Graph

1997 Commits

Author SHA1 Message Date
Giannis Dzegoutanis
a6613f9b9b better handle NetworkParameters in Address to allow other kind of networks 2014-09-30 14:17:31 +02:00
Mike Hearn
e9204fd196 HD Wallets: final part needed before release.
If a key is seen in a filtered block that is too far inside our lookahead zone, discard that block and any further blocks being sent to us by a remote peer and recalculate the Bloom filter after more keys are pre-calculated. Then restart the chain download process. This ensures that we can catch up/replay the block chain and keep up with the deterministic key sequence.
2014-09-23 15:01:22 +02:00
Mike Hearn
c24ede14a8 Add shade plugin to wallettemplate 2014-09-23 14:40:35 +02:00
Mike Hearn
bc0c9da33c WalletTemplate: Small visual tweaks 2014-09-22 20:07:56 +02:00
Mike Hearn
f237908308 Minor whitespace changes. 2014-09-22 20:07:47 +02:00
Devrandom
03bacf4fa9 Cache deterministic seed 2014-09-22 15:00:18 +02:00
Michael Bumann
cfd795ccbd Adding more examples.
This adds example usages of:
* using the WalletAppKit
* restoring a wallet from a seed
* sending coins
* implementing a WalletEventListener
2014-09-22 12:12:14 +02:00
Mike Hearn
a8e227ae1b PeerGroup: deduplicate bloom filter recalc events.
This whole thing needs to be refactored and rewritten to avoid having it be done on a separate thread.
2014-09-21 18:02:51 +02:00
Mike Hearn
753e0571e9 Narrow return type in unit test utility 2014-09-21 18:01:49 +02:00
Mike Hearn
9c355f01e6 PeerFilterProvider: minor comment updates 2014-09-21 18:00:52 +02:00
Mike Hearn
ec320ecfd5 GetDataMessage: add utilities 2014-09-21 17:54:55 +02:00
Mike Hearn
ecec739438 BloomFilter: provide transactions to a created FilteredBlock 2014-09-21 17:54:24 +02:00
Mike Hearn
8af5aa0c6c BitcoinUIModel: better parameter name 2014-09-21 17:53:56 +02:00
Mike Hearn
9d235ebc51 Bloom filtering upgrades: can now create FilteredBlock's by applying a BloomFilter to a block. This is primarily intended for unit testing. 2014-09-18 19:56:18 +02:00
Mike Hearn
f9659f08a2 PeerGroup: take out noisy debug log 2014-09-18 19:56:18 +02:00
Mike Hearn
88c4918f93 Script: better comment. 2014-09-18 19:56:18 +02:00
Mike Hearn
40c73eeac2 Script: take out obsolete todo comment. 2014-09-18 19:56:18 +02:00
Mike Hearn
8d83f4d25b Bloom filtering: add a convenience BloomFilter.insert(ECKey) method. 2014-09-18 19:56:18 +02:00
Mike Hearn
843e785daf Bloom filtering: Add equals/hashCode/toString to FilteredBlock and PartialMerkleTree then unit test round tripping. 2014-09-18 19:56:18 +02:00
Mike Hearn
d94d5bee8e Try slightly more useful error log in NioClientManager.handleKey whilst still keeping it concise. 2014-09-18 19:56:18 +02:00
Mike Hearn
325cc3e8fa OrchidSocketImpl: don't hold the stream lock whilst calling into stream. 2014-09-18 19:55:45 +02:00
Andreas Schildbach
57bec6165b Parse verifyFlags from script and tx JSON tests. In addition to P2SH (previously known as enforceP2SH), NULLDUMMY is implemented.
Update all script and tx JSON tests from Bitcoin Core.
2014-09-13 23:28:57 +02:00
Andreas Schildbach
aa14af564e Reduce log level of marked/un-marked messages to debug. It produces huge log files. 2014-09-11 15:08:36 +02:00
Kosta Korenkov
e1a4af2052 MissingSigResolutionSigner works for raw multi-sig 2014-09-11 19:37:14 +08:00
Kosta Korenkov
77f414fc62 Signers: skip signing if input is fully signed already 2014-09-11 19:18:09 +08:00
Kosta Korenkov
cf5089697b Fix extra signature added to the full scriptSig 2014-09-11 14:51:34 +08:00
Andreas Schildbach
3e5e3496ea Introduce textual checkpoint format. It's basically one base64-encoded line per checkpoint.
The BuildCheckpoints tool now generates and sanity checks both formats.
2014-09-10 17:59:41 +02:00
Adam Mackler
34214533c9 Take only as much time as necessary to open circuits for peer-IP DNS lookups
This patch addresses two suboptimal behaviors in the `TorDiscovery` class:

1. Currently it uses the DNS-lookup timeout as the timeout for opening
   circuits as well as for actually looking up the IP numbers.  It may
   be this timeout value, which is five seconds hard-coded into the
   `PeerGroup` class, was not intended for this purpose.  Moreover,
   the `TorConfig` class has a value, circuitBuildTimeout, apparently
   for this purpose; at least its default of 60 seconds may be more
   appropriate for this purpose than the five-second lookup timeout.

2. Currently, the process of opening circuits for the DNS lookups will
   take exactly as long as the timeout value, no more, no less, which
   practically guarantees that the client will either wait longer than
   necessary, or else experience timeout errors that could have been
   avoided by waiting a bit longer.

The changes herein use the return value of`TorConfig.getCircuitBuildTimeout()`
as the timeout for opening circuits, rather than using the DNS lookup
timeout value that is passed by `PeerGroup` as an argument to
`PeerDiscovery.getPeers()`.  Moreover, as soon as a circuit either has
been opened or failed to be opened for each router, the DNS lookups
then begin without waiting for the timeout time to elapse.

Notes:

1. There are no tests with these changes.  There don't seem to be any
   tests for the `TorDiscovery` class.  There probably ought to be.

2. The `TorDiscovery` class's DNS lookup procedure has the same
   timeout characteristic as the one this patch removes from the
   circuit-opening procedure, namely it waits for as long as the
   timeout value, no more no less.  If the changes proposed in this
   patch are acceptable, I would consider making the same change for
   the process of looking up the peer IP numbers.
2014-09-10 13:19:47 +02:00
Kosta Korenkov
691de1d22b Signers: Share keypaths for watching wallets
Now LocalTransactionSigner populates ProposedTransaction.keyPaths map even if
there is no private key in the wallet. Other signers may take advantage
of that.
2014-09-10 13:08:49 +02:00
Mike Hearn
dc857f0d83 Postgres store: Simplify a redundant if conditional. 2014-09-10 13:02:47 +02:00
Kosta Korenkov
f4879e22a6 Signers: Share keypaths for watching wallets
Now LocalTransactionSigner populates ProposedTransaction.keyPaths map even if
there is no private key in the wallet. Other signers may take advantage
of that.
2014-09-09 23:26:14 +02:00
Kosta Korenkov
5910a7f25e Married wallets: multisig threshold could be specified
That allows to create multisigs like 3-of-3. If not specified, majority of
keys will be required (2-of-3, 3-of-5 and so on)
2014-09-09 14:23:32 +02:00
Andreas Schildbach
96107b8b91 Replace "poor man's (aka. really, really poor) JSON parser" by Jackson for the script and tx tests.
The tests semantics was unchanged. 161 lines of code removed.
2014-09-09 14:19:49 +02:00
Devrandom
1f39dcdc6f Always use position 0 for LocalTransactionSigner sig, we don't know in advance what position we'll end up in
Fix p2sh bloom filter construction
Proper signature insertion for P2SH scriptSig
2014-09-09 14:15:54 +02:00
Martin Zachrison
7cb795235d Fixed grammar 2014-09-09 13:29:22 +02:00
Martin Zachrison
63b4b179e0 Payment channel API. Negotiation af the channel duration.
1. Client requests a time window, in seconds relative to now.
2. Server suggests an expire time, absolute time in seconds
3. Client accepts or rejects the servers proposal.
Note that the IPaymentChannelClient.ClinentConnection interface has a new method. This will break old implementations.
Let the client request the duration of a payment channel. Server can set allowed time window.
2014-09-09 13:29:22 +02:00
Mike Hearn
f569e10c17 Peer: reindent lines to match code style. 2014-09-08 18:26:36 +02:00
Mike Hearn
2b01508e10 Peer: fix the case where dependency download is disabled. It wasn't sending transactions to the wallet before. Add a test for this and add accessors for the setting. 2014-09-08 18:24:44 +02:00
Andreas Schildbach
302bb3e21d Use the new Transaction.SORT_TX_BY_UPDATE_TIME comparator and refresh comments. 2014-09-08 13:08:21 +02:00
Andreas Schildbach
2b80e4cfd1 Update script JSON tests from upstream. 2014-09-08 13:07:03 +02:00
Andreas Schildbach
2aa7f25a95 Provide a more meaningful exception when reaching past end of ASN.1 stream. Properly close ASN.1 decoder in exception paths.
A way to trigger the exception is running ScriptTest.dataDrivenValidTransactions().
2014-09-08 13:07:03 +02:00
Mike Hearn
c8803bdefe WalletTest: Better unit test failure message to check if the test is flaky. 2014-09-08 13:01:07 +02:00
Adam Mackler
a3073a0017 Don't bother pointless attempt to construct thread pool with no open circuits. 2014-09-08 12:57:00 +02:00
Andreas Schildbach
56603ff1f9 Fix version message. My heart breaks when I see the bad spelling of our dearest child in the logs. 2014-09-08 12:38:24 +02:00
Kosta Korenkov
c2d19a31a8 Wallet throws on missing signature by default
Using dummy sigs by default may be confusing for multi-sig scenarios.
See: https://groups.google.com/forum/#!topic/bitcoinj/PEhZGk3WMxU
2014-09-05 12:06:55 +02:00
Andreas Schildbach
ae24da4f9c When manually constructing SimpleDateFormat, specify Locale.US or otherwise we may end up on non-latin scripts.
See SimpleDateFormat javadoc for a discussion.
2014-09-04 14:17:23 +02:00
Andreas Schildbach
9f6f630dfb Catch AssertionError when connecting to sockets.
Annoyingly this is thrown on Android when libcore.io.Posix.getsockname() throws libcore.io.ErrnoException, rather than just an IOException.
2014-09-04 12:51:57 +02:00
Mike Hearn
a0d72294a0 Fix a buggy log message and make the comment clearer. 2014-09-03 18:55:10 +02:00
Andreas Schildbach
7d930554a6 Support for recording a memo with transactions. It can be used to record the memo of the payment request that initiated the transaction. Use the new SendRequest.memo register. 2014-09-03 16:13:41 +02:00
Michael Bumann
d09b69ebc5 make DeterministicSeed constructors public 2014-09-02 20:54:01 +02:00