Mike Hearn
db60bfc731
Provide network parameter IDs as constant strings. Make the "id" field of NetworkParameters private and make the getter upgrade the object using port as a heuristic if the field isn't present. Add a unit test to ensure we can convert old wallets to protobuf form. Resolves issue 134.
2012-02-07 22:34:39 +01:00
Mike Hearn
2b3e77bea9
Make a couple more Wallet methods public.
2012-02-07 21:49:12 +01:00
Mike Hearn
11a87317a4
Split transaction creation into building a template and then completing it. Completing a tx means adding inputs and possibly a change output to make the transaction valid. Also add a convenience addOutput() overload to Transaction. This makes it easier to create multi-sends.
...
Patch from Chris Rico.
2012-02-07 21:47:21 +01:00
Mike Hearn
b43b686264
Use finer grained locking in the BlockChain to make accessing the chain head responsive even whilst the chain is downloading and the object is under heavy load. This takes getChainHead() out of the profiles for ToyWallet and allows for removing the code added there to work around this issue.
2012-02-05 23:44:43 +01:00
Mike Hearn
7369c398ff
Improve a comment and make Wallet.receivePending() public.
2012-02-03 15:42:30 +01:00
Mike Hearn
c1cb5c10d5
Improve a log message
2012-02-03 14:09:43 +01:00
Mike Hearn
fff2034408
Copy test wallet into build directory, fixes a failing test case.
2012-02-03 14:00:12 +01:00
Mike Hearn
b0739df2e5
Expose hashTransactionForSignature. The API will likely change in future.
2012-02-03 12:29:36 +01:00
Mike Hearn
b72c170086
API for setting version messages on outbound connections, and implementing BIP 14. Resolves issue 105.
2012-02-03 12:29:36 +01:00
Mike Hearn
7f82613559
Migrate old wallets to use transaction confidences, as much as possible, and add a unit test for deserializing old wallets.
2012-02-03 12:29:36 +01:00
Miron Cuperman
be8d3c3896
Get rid of some warnings
2012-02-02 14:51:31 -08:00
Miron Cuperman
69ee4c7729
Be lenient in parsing tx confidence protobuf, store pubkeys, cleanup
2012-02-02 10:18:08 -08:00
Miron Cuperman
1c28bd3972
Persist TransactionConfidence to protobuf
2012-02-02 09:49:08 -08:00
Mike Hearn
3d470ec3f2
Make BlockTest.testDate pass outside of CET.
2012-02-02 15:37:24 +01:00
Mike Hearn
9afa4bf6a5
Create the localhost address without relying on a method that does DNS lookups behind the scenes. Resolves issue 120.
2012-02-02 15:00:46 +01:00
Mike Hearn
6b2275890a
Invoke onCoinsSent() when receiving a pending transaction that spends the wallets coins.
2012-02-02 14:49:46 +01:00
Mike Hearn
cf76cf064f
Add a comment to the EventListenerInvoker class.
2012-02-02 14:48:23 +01:00
Mike Hearn
1a4acc18be
Pubkeys are 65 bytes, not 32.
2012-01-26 18:40:24 +01:00
Mike Hearn
ad329d7a34
Callbacks for when a transaction in the chain is seen that spends coins from our wallet, not just to.
...
Introduce EventListenerInvoker to simplify the pattern by which event listeners can delete themselves safely whilst running.
Update the ToyWallet app to accept a public key:creation time pair on the command line and show all relevant transactions, to demonstrate (very crudely) the watching functionality.
2012-01-26 16:25:16 +01:00
Mike Hearn
1ff81a3243
Slight redesign of the ECKey API to allow you to have public only ("watching") keys.
2012-01-26 16:23:29 +01:00
Mike Hearn
f2d804d5cb
Fix a dumb seconds/milliseconds mismatch bug in Block.getTime(). Add a unit test.
2012-01-26 15:25:15 +01:00
Mike Hearn
67526ca8e2
Add an accessor to set the key creation time, along with another convenience c'tor to make the API a bit less inconsistent. Resolves issue 117.
2012-01-25 17:20:18 +01:00
Mike Hearn
63cef24fe4
Port Wallet to use getAppearsInHashes(), which resolves some failing unit tests.
2012-01-25 16:58:31 +01:00
Mike Hearn
3eb12c8e97
Merge branch 'master' of https://code.google.com/p/bitcoinj
2012-01-21 17:56:53 +01:00
Mike Hearn
8be3a7a027
Follow the protocol change that occurs on Feb 20th
2012-01-21 17:56:19 +01:00
Miron Cuperman
ed5adf3ea8
Disable the gen source directory for now as it is unused
2012-01-19 08:41:41 -08:00
Miron Cuperman
891cdcc02d
Remove dependence of WalletProtobufSerializer on BlockStore, migrate to Transaction.appearsInHashes
2012-01-19 08:36:29 -08:00
Mike Hearn
c7fd805e47
Provide a sendCoinsAsync that returns immediately instead of waiting for the tx to be broadcast. Change PeerGroup.broadcastTransaction to return a Future<Transaction> and only consider the tx to be broadcast once it was written to at least one peer directly (not waiting for a response to an inv). Re-plumb the peer group thread to poll for tasks when there are active peers.
2012-01-16 19:16:16 +01:00
Mike Hearn
3fa5c89b3e
Set newly created wallet transactions to have NOT_SEEN_IN_CHAIN confidence rather than UNKNOWN.
2012-01-16 17:47:52 +01:00
Mike Hearn
e6612ad112
Add a .gitignore file that contains the target directory.
2012-01-16 17:44:10 +01:00
Miron Cuperman
5d27257b7a
Rationalize protobuf Pool enum
2012-01-11 16:29:09 -08:00
Miron Cuperman
b29f669bca
Fixes to protobuf building from Gary
2012-01-11 16:04:14 -08:00
Miron Cuperman
775f5241e3
Allow building without protobuf-compiler installed
2012-01-11 13:34:14 -08:00
Miron Cuperman
9f90ae2f0e
Fix test, upgrade to protobuf 2.4.1, doc
2012-01-11 12:41:14 -08:00
Miron Cuperman
1a2ce7d982
Fixes based on input from Mike, fix invariant checking, fix spentBy
2012-01-11 10:44:08 -08:00
Miron Cuperman
a8fd0d474d
Wallet protobuf cleanup.
...
* Un-nest protobuf
* Add rest of tx fields, ASN.1 private key
* Pending-inactive combo
* Tests
2012-01-10 16:05:38 -08:00
Miron Cuperman
319c52b2a6
Read Wallet from protobuf stream
2012-01-10 15:50:45 -08:00
Miron Cuperman
6af16c863c
Protobuf serialization for Wallet
2012-01-10 15:50:43 -08:00
Miron Cuperman
0e7e583626
Fix merge mistake, fix PeerGroup.stop
2012-01-09 12:59:44 -08:00
Mike Hearn
76ea1d35e9
Repair the damage caused by a bad merge in rev 56489f9fc60c
2012-01-09 10:55:32 -08:00
Mike Hearn
32f41dc1a9
Address some review comments from Miron.
2012-01-09 10:55:31 -08:00
Mike Hearn
35ec0b669d
Wallet side of the quick hack (oops)
2012-01-09 10:54:04 -08:00
Mike Hearn
5ce1d21e4c
Quick hack (unfinished API) to clear out wallet transactions so you can replay the wallet in case of bugs, like forgetting to save the wallet when you need to.
2012-01-09 10:54:04 -08:00
Mike Hearn
edb3814b56
Couple of minor concurrency fixes.
2012-01-09 10:54:04 -08:00
Mike Hearn
de6d27aef8
Announce pending transactions in wallets when a peer connects (both self-created spends and relevant received transactions). Allow creation of transactions without broadcast, for offline wallets.
2012-01-09 10:54:03 -08:00
Mike Hearn
2ef9fa389c
Add an ugly toy wallet app, which will evolve into a more fully fledged example of a MultiBit style app. This keeps it obvious how much boilerplate type code is needed and what other features might be helpful. Currently it just shows transactions received with their confidences.
2012-01-09 10:51:27 -08:00
Mike Hearn
37ff135638
Add an accessor for network params to the wallet. Bugfix for TransactionConfidence (again)
2012-01-09 10:51:27 -08:00
Mike Hearn
6813ff4e69
Remove memory usage optimization that was complicating things.
2012-01-09 10:51:27 -08:00
Mike Hearn
c0a295eed1
Rework how event listeners are called, so tx confidences are updated at the end of the receive process. Otherwise it's possible for the wallet to get confused because the state can change in the middle of processing. Document this and add a test. Update PingService. Also, change onCoinsReceived so it's only called once per transaction, to know when a tx appears in a block requires registration of a tx confidence listener.
2012-01-09 10:51:26 -08:00
Mike Hearn
9d5465390d
Add event listeners to the TransactionConfidence object and a duplicate method.
2012-01-09 10:50:08 -08:00