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

140 Commits

Author SHA1 Message Date
Mike Hearn
a1562836be Payment protocol: Make PaymentSession use a global thread pool that uses daemon threads.
Fixes a 60 second hang that could occur in wallet-tool once the send request was processed. Fixing this revealed another bug - WalletTool was depending on this VM shutdown delay caused by the worker pool timeout, so clean up the code and replace with a blocking get of the future.

Also support the --offline and --password flags when using the payment protocol.
2014-01-28 13:58:08 +01:00
Mike Hearn
ddec4f9106 Allow Bitcoin URI's that don't have any address component if the r= payment protocol param is there. 2014-01-28 13:04:09 +01:00
Kevin Greene
3966875e8e Adding support for processing PaymentRequests. 2014-01-28 09:46:51 +01:00
Mike Hearn
fa53806ef5 WalletTool: bit more cleanup. 2014-01-13 12:30:00 +01:00
Mike Hearn
c0617b31b2 Simplify the WalletTool command line and move help to an external file. 2014-01-12 21:11:35 +01:00
Mike Hearn
ce4ac86884 Move discovery package into net package. 2013-12-10 13:13:52 -08: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
Mike Hearn
70cd2ffb96 Wallet: throw exceptions when completing a transaction fails.
If there's insufficient balance (typical error) then InsufficientMoneyException is thrown (checked).
If the SendRequest is bad in some way, like asking to create a spend that would violate the protocol rules, IllegalArgumentException is thrown (unchecked).

Also make VerificationException (and thus ProtocolException+ScriptException) unchecked.

Resolves issue 425.
2013-11-27 15:25:52 +01:00
Mike Hearn
95fc6d7245 WalletTool: recognize private key format properly.
Resolves issue 390.
2013-11-24 19:10:56 +01:00
Mike Hearn
688ba42c45 WalletTool: allow skipping of mandatory extensions.
This allows it to read MultiBit wallets.
2013-11-10 20:03:30 +01:00
Mike Hearn
f27430c356 Refactor/bugfix broadcast of pending transactions when a peergroup starts up.
Previously the PeerGroup itself would broadcast the pending transactions by simply sending an inv with them all to every peer. This is a good way to get a transaction blasted out if there are no problems with it, but it means we cannot track propagation and the numBroadcastPeers() value was correspondingly not increased. This seems to be causing issues with the Android wallet. So try out a different approach - have the wallet use broadcastTransaction as per normal on the PeerGroup when it's added. The TX will be propagated and watched as with a normal spend.
2013-10-11 14:50:53 +02:00
Mike Hearn
2e924e217d WalletTool: fix typo 2013-10-11 14:32:44 +02:00
Mike Hearn
e67b3e540e Remove usage of some deprecated stuff. 2013-09-23 15:33:36 +02:00
Mike Hearn
de9d5e95ab Add a tool to watch for broadcasts of rotation transactions. 2013-08-13 15:05:03 +02:00
Mike Hearn
2808b062d7 Version 0.11-SNAPSHOT 2013-07-30 14:47:39 +02:00
Mike Hearn
d3842cc0f4 Wallet: Print Wallet extensions in toString() and make tx printouts optional. 2013-07-25 14:11:42 +02:00
Mike Hearn
d0a431cd9c WalletTool: add support for the emptying out feature. 2013-07-25 11:28:32 +02:00
Mike Hearn
35a7f38d86 Make block chain listeners run in given executors and default to the user thread. 2013-07-05 10:54:21 +02:00
Mike Hearn
fbd767320c Delete the long since obsolete DiskBlockStore. 2013-06-20 15:10:47 +02:00
Mike Hearn
8b8bf50144 Version 0.10-SNAPSHOT 2013-06-18 16:33:06 +02:00
Mike Hearn
1d9ebf5a5f WalletTool: allow use of regtest mode, fix unixtime flag, make address printed by ADD_KEY double clickable. 2013-06-12 11:13:01 +02:00
Mike Hearn
5b50e52842 Don't require 4G heap for wallet tool. 2013-06-12 11:12:15 +02:00
Mike Hearn
46914b12b7 Make completeTx once again return a bool (pending replacement with an exception), and update the fee field with the calculated fee. 2013-06-11 11:40:40 +02:00
Mike Hearn
9a389c9475 Move enforceDefaultClientFeeRelayRules into SendRequest instead of being a parameter.
Make WalletTool enforce the rules instead of ignoring them (this was an oversight).
2013-06-10 15:51:34 +02:00
Matt Corallo
375e553bdc Add basic fee solver to Wallet.completeTx and extensive testing.
This also adds support for SendRequests which have some predefined
inputs (already signed), which will be tested in a later commit.
2013-06-05 16:28:35 +02:00
Mike Hearn
f4c3b6a49d Global search and replace to use the param-class specific instance getters and prodNet -> MainNetParams.
The old "prodnet" name could be confusing to non-native speakers or people who just haven't been exposed to Google lingo. Main net is more idiomatic.

Conflicts:
	tools/src/main/java/com/google/bitcoin/tools/BlockImporter.java
2013-06-05 14:10:40 +02:00
Mike Hearn
52586edb33 NetworkParameters: Refactor out into separate classes.
Hide fields behind getters and make unit tests create anonymous subclasses
to tweak them rather than overwriting global variables.

Introduce a regtest params class for use in the comparison tool.

Conflicts:
	core/src/test/java/com/google/bitcoin/core/BitcoindComparisonTool.java
	core/src/test/java/com/google/bitcoin/core/FullPrunedBlockChainTest.java
2013-06-05 14:10:39 +02:00
Mike Hearn
8043bc335b NetworkParameters: hide port behind a getter. 2013-06-05 14:10:38 +02:00
Matt Corallo
ecca1c6f47 Add new BlockImporter. 2013-06-04 22:18:11 +02:00
Matt Corallo
a131d08a58 Move BlockImporter to a util and make it an Iterator<Block> 2013-06-04 22:18:11 +02:00
Mike Hearn
aa883b48b1 Wallet: Rewrite re-org handling to be simpler and use less code. And hopefully fix some bugs along the way. 2013-04-26 16:42:15 +02:00
Mike Hearn
f88bdc5fe3 Wallet: make keychain private and add a remove method. 2013-04-22 13:45:38 +02:00
Mike Hearn
5112a94955 WalletTool: remove redundant if test 2013-04-22 13:36:12 +02:00
Mike Hearn
5eebca2c7d Wallet: Add some convenience methods for spending unconfirmed transactions. 2013-04-12 11:10:31 +02:00
Mike Hearn
f1845dd552 Version 0.9-SNAPSHOT 2013-04-11 14:27:35 +02:00
Matt Corallo
2e6e0661cb Import from new block dir format
Also fixes a few minor bugs in BlockImporter.
2013-04-01 18:03:19 +01:00
Mike Hearn
aac6a7daf7 WalletTool: allow dumping the wallet without a chain.
Resolves issue 357.
2013-03-30 18:07:20 +00:00
Mike Hearn
3d6691c82a Switch to using DNS for testnet discovery, as LFnet has gone away.
Put DNS seeds into NetworkParams.
Deprecate IrcDiscovery and remove the unit tests for it.
Update examples and tools to use DNS for everything.
Resolves issue 299.
2013-03-29 17:39:24 +00:00
Mike Hearn
f8e5b17b85 Add crap WalletTool hack to work around issue with Netty. 2013-03-21 14:23:55 +01:00
Mike Hearn
0c3096ed74 Add a --unixtime flag to wallet-tool ADD_KEY 2013-03-18 23:24:59 +01:00
Mike Hearn
eb2da1e33f Implement support for password protected wallets and spending unconfirmed transactions in WalletTool. 2013-03-18 18:27:13 +01:00
Mike Hearn
5d0518dafd Merge encrypted wallets functionality by Jim Burton. 2013-03-18 18:27:12 +01:00
Mike Hearn
0534231de9 Run wallet event listeners unlocked. Resolves another inversion.
Update issue 223.
2013-03-07 17:08:15 +01:00
Mike Hearn
8355a03439 Require last checkpoint to be at least 1 month old. 2013-03-05 14:48:28 +01:00
Mike Hearn
0419887407 Add a CheckpointManager class and a BuildCheckpoints tool that saves a set of checkpoints to disk. By default there is one every difficulty transition period (two weeks), which means a relatively small amount of RAM needed to hold them all. There are only 111 checkpoints so far and old ones can be thinned out if needed. 2013-03-05 14:48:28 +01:00
Mike Hearn
a61cd9eb19 Switch WalletTool to SPVBlockStore. 2013-03-05 14:48:28 +01:00
Mike Hearn
420a29a388 Properly support importing dumped private keys in WalletTool. 2013-02-20 00:05:49 +01:00
Mike Hearn
72d6f23e92 Version 0.8-SNAPSHOT 2013-02-19 16:11:22 +01:00
Mike Hearn
586f961b1b Minor WalletTool fixes:
1) Print balance in friendly form
2) Use PeerGroup.stopAndWait() to avoid trying to close the store in parallel with network threads shutdown.
2013-02-05 12:00:33 +01:00
Mike Hearn
6504296b79 Avoid confusing bugs by switching NetworkParameters.testNet() to be testnet3 not testnet2. 2013-01-16 18:15:46 +01:00
Mike Hearn
e4e4e45a47 Allow re-signing of transactions and re-sign after adjusting the sequence number. 2013-01-12 14:47:43 +01:00
Mike Hearn
a6f1233b4e Delete some 0.5 -> 0.6 migration code from WalletTool. 2013-01-12 14:27:49 +01:00
Mike Hearn
b5b43f3a15 Better support for lock timed transactions.
Lock times are now included in various toString dumps.
Transactions can estimate their lock time when the time is specified as a block number.
Add support to WalletTool for creating timelocked transactions.
2013-01-12 14:26:59 +01:00
Mike Hearn
f2db0028ca Slightly improve wallet-tool help text. Updates issue 273. 2013-01-12 14:26:59 +01:00
Mike Hearn
93870110c3 Use blocking PeerGroup startup in WalletTool 2013-01-10 14:12:58 +01:00
Mike Hearn
f2a6e41c82 Don't abuse BigIntegers in WalletTool/Utils when parsing hex pubkeys. 2013-01-08 17:33:19 +01:00
Mike Hearn
16668390b3 Support full verification in wallet tool. 2012-12-10 23:30:22 +01:00
Mike Hearn
7873254b2d Move BlockImporter from examples to tools. 2012-11-01 16:48:24 +01:00
Mike Hearn
6f036f9cf2 s/BitCoinJ/bitcoinj/ everywhere except the version handshake.
Resolves issue 249.
2012-11-01 16:24:26 +01:00
Mike Hearn
254393253c Version 0.7-SNAPSHOT 2012-09-24 15:27:30 +02:00
Mike Hearn
04772a7aa8 Allow setting the creation time for newly created keys (this is useful for testing) 2012-09-09 15:25:58 +02:00
Mike Hearn
087a4f2447 Close block store after finding height for wallet import. 2012-09-07 15:11:32 +02:00
Mike Hearn
8003266a66 Set the tx depth fields whilst loading 0.5 era wallets if the chain height is provided before load. This does NOT migrate workDone as that'd involve scanning potentially the entire block store and nobody uses this data much today. Resolves issue 240. 2012-09-06 18:50:35 +02:00
Mike Hearn
572f2a4f4e Implement the ability to explicitly set a fee in the Wallet.SendRequest. Does not yet auto-calculate the correct fees. Resolves issue 45. Resolves issue 245. 2012-09-06 17:45:04 +02:00
Mike Hearn
48b4eb95a6 Update WalletTool to new send API. 2012-09-06 15:05:20 +02:00
Mike Hearn
56d74d504a Another pass at the auto-save code. Resolves issue 246. 2012-08-30 15:39:31 +02:00
Mike Hearn
6f6c5d6773 Add a toString overload on Wallet. Print private keys in WalletTool when available. 2012-08-20 16:01:19 +02:00
Mike Hearn
fd9eba1697 Change PeerGroup.broadcastTransaction() to wait for propagation.
It means a send won't be considered completed until it's accepted by the net.
Also is for the case where you receive a transaction (eg, via Bluetooth) and
you want to broadcast it such that you can know it's valid.

Make WalletTool use --peers instead of --peer, a comma separated list of
addresses to use. Remove the crappy sleep after send now we can wait.

Resolves issue 167.
2012-07-22 01:20:48 +02:00
Mike Hearn
bc47fccaeb Add an auto save function. A background thread will atomically auto-save to a file when there are wallet changes at a limited rate. 2012-07-21 22:37:39 +02:00
Mike Hearn
26912547ce Fix minor bug in wallet-tool wrapper script (it sucks anyway) 2012-07-05 16:01:44 +02:00
Mike Hearn
893013b415 Remove a couple of redundant Maven <version> tags. 2012-06-08 17:21:38 +02:00
Mike Hearn
6fec1263ff Add a RAW_DUMP command to wallet tool. 2012-06-08 16:30:23 +02:00
Mike Hearn
335863c75d Add some helpers for creating pubkey-only outputs.
Allow spending of pubkey outputs. There are unit tests but not manually tested yet.
Implement toString() logic for printing pubkey inputs/outputs.
Don't consider coinbase transactions relevant until Jims work is in.
Support sending to pubkeys in wallet-tool
2012-06-07 10:57:34 +02:00
Mike Hearn
dffe7f1348 Horrible hack to ensure WalletTool sends transactions. For some reason the socket gets torn down before it had a chance to write the packets out to the network. 2012-06-07 10:55:15 +02:00
Mike Hearn
02db1509a3 A quick hack for wallet-tool until I learn Maven better. 2012-06-03 15:49:38 +02:00
Mike Hearn
216b5a4d65 Remove a useless <excludes> section. 2012-06-03 15:49:21 +02:00
Mike Hearn
7705bd59a4 Version 0.6-SNAPSHOT 2012-05-21 16:46:44 +02:00
Mike Hearn
e42063806c Write+rename wallet files. 2012-05-21 15:31:21 +02:00
Mike Hearn
0739a6f674 Port to the latest BouncyCastle API and switch to the SpongyCastle lightweight API. It has the following benefits:
- Keeps us up to date with the crypto library
 - Resolves the need for an Android artifact by using a renamed lib
 - Switches to the lightweight API so minimizes our dependencies, which is also required for the native branch to be merged

 Resolves issue 171
2012-05-18 17:03:55 +02:00
Mike Hearn
0a3189c3b4 WalletTool: fix --help and allow privkeys/pubkeys to be parsed as hex or base58. 2012-05-02 17:56:05 +02:00
Miron Cuperman
6a82462d2d More Wallet consistency checks 2012-05-01 18:45:48 -07:00
Mike Hearn
0ab36f7839 Some more wallet-tool fixes/improvements. 2012-04-06 18:41:53 +02:00
Mike Hearn
ece8f548a9 Support for sending money from wallet-tool. 2012-04-06 14:37:49 +02:00
Mike Hearn
b7379d562f WalletTool improvements:
- Can now wait for blocks, wallet-relevant transactions or for wallet balance to meet a given condition
 - Simplified the code somewhat
2012-04-05 20:34:31 +02:00
Mike Hearn
6368862ffe Clear out some more FindBugs warnings. 2012-04-04 23:52:02 +02:00
Mike Hearn
0c90081c12 Make wallet tool compile to a minimized, bundled JAR so it can be used standalone, and change the wallet-tool script to use it that way. It makes running much faster. 2012-04-02 16:13:45 +02:00
Mike Hearn
a119286b29 POM changes and refactorings from Gary. 2012-03-16 13:20:50 +01:00
Mike Hearn
6e162057c1 Removed IML files from git. 2012-03-13 19:00:33 +01:00
Mike Hearn
0e52c98c45 Use the standard Maven directory layout, rename "lib" to "core". Mavenize submodules. 2012-03-13 18:57:03 +01:00
Mike Hearn
216deb2d35 Re-organize the source tree so people can depend on bitcoinj without pulling in the examples, tools, or dependencies thereof. 2012-03-11 20:01:12 +01:00