3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-31 15:22:16 +00:00
Commit Graph

946 Commits

Author SHA1 Message Date
Mike Hearn
c5665d68b5 Wallet: misc cleanups.
Clear some static analysis warnings.
Throw more appropriate exception types in some cases.
Add a few internal assertions.
Better nullity annotations.
2013-12-22 19:13:23 +01:00
Mike Hearn
f318808cf7 Clean up WalletTransaction and serialization code a bit. 2013-12-22 19:04:24 +01:00
Mike Hearn
b3673999d4 Move WalletTransaction into the wallet package. 2013-12-22 18:48:46 +01:00
Mike Hearn
43460f451a MnemonicCode: Clean up a bit. 2013-12-20 17:35:11 +01:00
Ken Sedgwick
29e2af7ec0 Update to latest version of mnemonic code spec from the Trezor team. 2013-12-20 17:15:24 +01:00
Mike Hearn
8cc1920fa2 ECKey: use sumOfTwoMultiples for better/faster key recovery.
Thanks to Peter Dettman for the tip. Resolves issue 492.
2013-12-15 14:55:43 -08:00
Mike Hearn
e9bf717409 ConnectionHandler: Remove a always-true if condition. 2013-12-15 09:31:07 -08:00
Mike Hearn
25a08c6d75 NioClientManager: minor fix revealed by static analysis. 2013-12-15 09:29:59 -08:00
Mike Hearn
42e75b86cf PeerGroup: add a couple of missing nullable annotations 2013-12-15 09:27:38 -08:00
Matt Corallo
c61ec5023e Fix race in TestWithNetworkConnections
There was a nasty bug where a connection-failed interrupt was
run afer any interruptible calls were made, making the next
test-case fail due to interruption.
2013-12-15 09:27:19 -08:00
Mike Hearn
f7a944983c ECKey: use Bouncy Castle to decompress keys. Thanks to Peter Dettman for the hint. Resolves issue 493. 2013-12-14 14:12:52 -08:00
Mike Hearn
8f48b119b7 AbstractBlockChain: minor style fixes from the inspector. 2013-12-14 13:35:22 -08:00
Mike Hearn
30455cb5ce Suppress some more info logging and update some javadocs. 2013-12-14 13:21:33 -08:00
Devrandom
462c75324e Faster FP tracking using double exponential 2013-12-14 12:42:44 -08:00
Mike Hearn
1293e42aa3 BloomFilter: minor readability tweak 2013-12-14 11:42:41 -08:00
Matt Corallo
2f29660d0d Fix broken test case. 2013-12-14 01:11:52 -05:00
Mike Hearn
77f99a596f Log balance in wallet.toString better 2013-12-13 16:57:28 -08:00
Mike Hearn
cdfa0ae61b ECKeyTest: once again, fix a flaky decrypt test. There's no MAC on the encrypted bytes so you can't assume padding checks will always catch corrupted data. 2013-12-13 16:08:54 -08:00
Devrandom
7e4f6369e4 Clean up false positive handling, add unit test 2013-12-13 16:00:42 -08:00
Devrandom
ba9415b3ee Force update Bloom filter when false positive rate gets high 2013-12-13 16:00:41 -08:00
Devrandom
751434ba7c Fix bloom filter sizing with watched scripts 2013-12-13 15:59:07 -08:00
Mike Hearn
86b42b7fe5 Remove disconnectOldVersions2 as it tests nothing, probably a bad merge conflict. 2013-12-13 15:55:08 -08:00
Mike Hearn
e4e2e60627 Fix DnsDiscovery javadocs and make a couple of fields final. 2013-12-13 09:29:08 -08:00
Mike Hearn
c278867186 Add a unit test for Script.toString and don't emit trailing whitespace. 2013-12-12 08:11:23 -08:00
Mike Hearn
4bbcfc4377 Don't print script creation timestamp in Script.toString() 2013-12-12 08:09:15 -08:00
Mike Hearn
22a58755db Print peer times using String.format. Resolves issue 495. 2013-12-11 19:13:46 -08:00
Mike Hearn
2f8740f8a8 Remove usage of deprecated method in PeerTest. 2013-12-11 10:39:31 -08:00
Mike Hearn
24d38cdba4 Check for and reject null event listeners. 2013-12-11 10:00:35 -08:00
Matt Corallo
2879f7bb9b Fix memory leak of downloadListener 2013-12-11 10:00:35 -08:00
Ken Sedgwick
a0f32ab0d2 Improved comment. 2013-12-10 17:49:45 -08:00
Ken Sedgwick
e86ce7f268 Updated to latest version of BIP-0039. 2013-12-10 17:49:45 -08:00
Ken Sedgwick
5cd10a537a Added Mnemonic{Length,Word,Checksum}Exception and tests for each case. 2013-12-10 17:49:45 -08:00
Mike Hearn
69f52c1b8a Bug fix to avoid a flake in PeerTest.
There seem to be other cases where unit tests can be flaky with nonetty. More fixes will come later.
2013-12-10 13:51:18 -08:00
Mike Hearn
ce4ac86884 Move discovery package into net package. 2013-12-10 13:13:52 -08:00
Mike Hearn
3318d15194 Rename networkabstraction package to just net 2013-12-10 13:12:22 -08:00
Matt Corallo
c10ebd260c Fix reentrance bug when writing in connectionOpened. 2013-12-10 13:03:15 -08:00
Matt Corallo
ba543a3b10 Only do network writes on the handler thread in nio wrappers 2013-12-10 13:03:15 -08:00
Matt Corallo
abe9513dde Don't allow setting writeTarget twice. 2013-12-10 13:03:15 -08:00
Mike Hearn
4b035535e2 nonetty: Print fewer stack traces on errors. Handle failure of initial connect call. 2013-12-10 13:03:15 -08:00
Mike Hearn
68a614a33b nonetty: Fix a couple of unit test bugs.
Remove references to netty that still appeared in comments/POM
2013-12-10 13:03:15 -08:00
Matt Corallo
534cec9791 Rewrite the network stack.
Remove Netty entirely, using the new Nio wrapper classes instead

* BitcoinSerializer now uses ByteBuffers directly instead of
  InputStreams.
* TCPNetworkConnection and NetworkConnection interface deleted,
  Peer now extends the abstract class PeerSocketHandler which
  handles deserialization and interfaces with the Nio wrapper
  classes.
* As a part of this, all version message handling has been moved
  to Peer, instead of doing it in TCPNetworkConnection.
* Peer.setMinProtocolVersion() now returns a boolean instead of a
  null/non-null future which holds the now-closing channel.
* Peer.sendMessage (now PeerSocketHandler.sendMessage()) now
  returns void.
* PeerGroup has some significant API changes:
  * removed constructors which take pipeline factories,
    makePipelineFactory, createClientBootstrap
  * Replaced with a setSocketTimeoutMillis method that sets a
    timeout between openConnection() and version/verack exchange.
    (Note that because Peer extends AbstractTimeoutHandler, it has
    useful timeout setters public already).
  * connectTo returns a Peer future, not a ChannelFuture
  * removed peerFromChannelFuture and peerFromChannel
* Peer and PeerGroup Tests have semi-significant rewrites:
  * They use actual TCP connections to localhost
  * The "remote" side is a InboundMessageQueuer, which queues
    inbound messages and allows for writing arbitrary messages.
  * It ignores certain special pings which come from pingAndWait,
    which is used to wait for message processing in the Peer.
  * Removed a broken test in PeerGroupTest that should be reenabled
    if we ever prefer a different version than our minimum version
    again.
  * Removed two duplicate tests in PeerTest (testRun_*Exception)
    which are tested for in badMessage as well.
  * Added a test for peer timeout and large message deserialization

Author:    Matt Corallo <git@bluematt.me>
2013-12-10 13:03:14 -08:00
Mike Hearn
81f8b230e3 Script.toAddress now can cast to P2SH addresses. 2013-12-10 11:45:29 -08:00
Mike Hearn
ea6f2a0fc3 Payment channels: invoke destroyConn on server side even when client requested it.
This allows servers to do something useful when the channel closes normally, like forward the money onwards.
2013-12-10 11:39:30 -08:00
Mike Hearn
54b1054d03 Add a couple of utility methods for working with P2SH scripts. 2013-12-10 11:38:45 -08:00
Mike Hearn
cebebcef69 Fix unit test failure caused by bad merge. Resolves issue 489. 2013-12-01 13:04:25 +01:00
Mike Hearn
963978c468 Add watched scripts to the wallet toString output.
Support watching scripts/addresses in WalletTool
2013-11-30 16:39:58 +01:00
Devrandom
da2e3e6c98 Support watching of scripts/addresses in wallet 2013-11-30 16:39:58 +01:00
Mike Hearn
2271e7198e Better error handling in Address. 2013-11-30 15:33:24 +01:00
Mike Hearn
98081f0568 Support sending to P2SH addresses. Thanks to Mike Belshe.
Resolves issue 461.
2013-11-30 15:14:52 +01:00
Mike Rosseel
7083c8b669 Increase test coverage. 2013-11-27 17:55:43 +01:00