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
Mike Hearn
49729fe0b0
Add a numConnectedPeers() accessor to PeerGroup.
2012-01-09 10:50:08 -08:00
Mike Hearn
e2885e816e
Minor typo fix.
2012-01-09 10:50:08 -08:00
Mike Hearn
9147c1bae5
Confidence levels now include double spending of transactions. Add a unit test to check the inbound finney attack case, in which a double spending block overrides a pending transaction.
2012-01-09 10:50:07 -08:00
Mike Hearn
d39eb96ccc
Put a bound on the size of the peer transaction pools.
2012-01-09 10:50:06 -08:00
Mike Hearn
ca0407f91a
Store a transaction in the Peer if we've seen it before.
2012-01-09 10:48:37 -08:00
Mike Hearn
5126745e01
Add a couple of methods to TransactionConfidence to get depth in chain measured in blocks and work done. Add example of usage to PingService. Still not quite there yet.
2012-01-09 10:48:35 -08:00
Mike Hearn
0a4dbb77cf
First cut at transaction confidence levels. Expose a TransactionConfidence object that is updated by peers and wallets, which tracks how many peers have announced the transaction and the height of the transaction in the best chain (if any). Unit tests that check it does the right thing with re-orgs. Various small cleanups and simplifications in the tests.
2012-01-09 10:46:40 -08:00
Mike Hearn
a5fc1c8cc5
Address more of Mirons review comments. Peers and PeerGroups now notify PeerEventListeners of broadcast transactions. Wallets provide an event listener object (note: they don't implement directly as most events are not of interest). Convenience APIs are provided to make linking it all together clearer.
2012-01-09 10:44:50 -08:00
Mike Hearn
c9be40c9dc
Address some review comments from Miron:
...
- Remove safety check that could disguise bugs in future
- Typo fix.
Fix a bug that caused the tx.isPending() flag to be wrong inside callbacks, revealed by manual testing. Improved unit test realism to catch this case.
2012-01-09 10:38:59 -08:00
Mike Hearn
543542c551
Allow specification of the remote peer to connect to in PingService.
...
Save the wallet after receiving a pending transaction.
2012-01-09 10:37:04 -08:00
Mike Hearn
7aa485110a
First cut at a pending transactions patch. This isn't the final API, which will
...
involve some changes to the wallet event listener/tx to have a concept of
confidence levels.
2012-01-09 10:35:41 -08:00
Mike Hearn
e6acc153ad
Temporarily disable a couple of non-deterministic tests.
2012-01-09 12:09:11 +01:00
Mike Hearn
6fc9e758b7
Merge branch 'master' of https://code.google.com/p/bitcoinj
2012-01-09 12:02:33 +01:00
Mike Hearn
623389a156
Address comments from Miron and Andreas:
...
- Make GetBlocksMessage/GetHeadersMessage implement toString/hashCode
- Minor comment/naming fixes
- > not >= for comparing fast catchup time to block header
- Return current time in Wallet.getEarliestKeyCreationTime() rather than throw an exception when there are no keys in the wallet.
2012-01-09 11:57:08 +01:00
Miron Cuperman
247a07a3ab
Prepare Derby for merging
2012-01-05 16:04:37 -08:00
Miron Cuperman
826f2d2c51
Small cleanup and optimization for Derby store
2012-01-05 16:04:37 -08:00
Miron Cuperman
cf824dfbce
Make unit test genesis block pass verification
2012-01-05 16:04:37 -08:00
Miron Cuperman
b7b1c039dc
Cleanup and finish merge with 0.3
2012-01-05 16:04:37 -08:00
Miron Cuperman (devrandom)
f731c8591d
Commit every 2 seconds instead of after every write
2012-01-05 16:04:37 -08:00
Miron Cuperman
075602aafd
Apache Derby backed BlockStore, and a matching PingService
...
Conflicts:
src/com/google/bitcoin/core/DiskBlockStore.java
2012-01-05 16:04:37 -08:00
Mike Hearn
dd2be6eeb4
Make ECKey store its creation time. Implement fast catchup using the getheaders command. You can now set a date on a Peer/PeerGroup, before which block bodies will not be fetched. After that they will. Using the date of the earliest key in the wallet means new users can get started faster and with less battery drain as they aren't parsing blocks that are guaranteed to have no relevant transactions.
2011-12-29 23:52:08 +00:00
Mike Hearn
da10e0ca69
Update TODO file.
2011-12-29 20:27:45 +00:00
Mike Hearn
1a107952b9
Reformatting of comments to 120 cols.
2011-12-29 13:32:54 +00:00
Mike Hearn
1b5252fd61
Fix a bug that could cause transactions to not move from the unspent to spent maps (efficiency issue but not a correctness issue). Add change outputs to the fake transactions created by TestUtils to reveal the issue and add more pool size tests. Resolves issue 89.
2011-12-27 23:40:45 +00:00
Mike Hearn
57d26107de
Delete a fairly useless unit test that was also non-deterministic.
2011-12-27 23:27:52 +00:00
Mike Hearn
234090e5a6
Add numPeers() and getPeers() accessors to PeerGroup. Resolves issue 106.
2011-12-27 12:04:49 +00:00
Mike Hearn
b9a141a96b
Update DNS seeds list.
2011-12-17 01:14:52 +01:00