Mike Hearn
527274a40f
Add FilteredBlock.getPartialMerkleTree()
2015-04-07 19:26:32 +02:00
Mike Hearn
c426e34646
Bug fix: don't pointlessly download a transaction we already have because we're broadcasting it.
...
This is a regression caused by the TxConfidenceTable rewrite: previously it pinned entire transactions and that was used to notice that a broadcast was happening. Now it only pins confidence objects. So instead we use the confidence.source property: if it's SELF then we assume we have it somewhere in the address space and don't bother downloading it when a peer announces it. If it's UNKNOWN then PeerGroup.broadcastTransaction will set it to SELF.
2015-04-07 15:37:22 +02:00
Mike Hearn
325e7e170b
Transaction: print a log warning if lock time is set and a sequence number has not been. This is a common programming error.
2015-04-07 15:35:28 +02:00
Mike Hearn
1e7a13dd27
PeerGroup: better stall handling.
...
Calculate a moving average of the actual download speed and use it to decide when to disconnect. If the network is pathologically slow and we keep stalling, give up after the third time.
2015-04-06 19:01:19 +02:00
Mike Hearn
09744edfe3
Context: some small fixes + javadocs for WalletAppKit
2015-04-06 17:20:03 +02:00
Mike Hearn
b5994e3788
A bit of unit test cleanup.
2015-04-06 16:34:59 +02:00
Mike Hearn
7576a44ef4
getutxo: Bugfixes identified by static analysis
2015-04-06 15:32:02 +02:00
Mike Hearn
037ec5aef9
getutxo: Flesh out the JavaDocs, link to the BIP, include brief security discussion, and make Peer support multiple in flight queries at once.
2015-04-06 15:14:31 +02:00
Mike Hearn
4c12127501
Context: add c'tors that take a context to [Abstract/FullPruned/]BlockChain and PeerGroup. The existing c'tors now do a consistency check against the existing context or create a new one on the fly.
2015-04-05 19:52:58 +02:00
Mike Hearn
960e58343e
Context: more TODOs
2015-04-03 19:42:36 +02:00
Oscar Guindzberg
64e09452f4
PeerSocketHandler: bugfix for incomplete message headers at the end of
...
the buffer
2015-03-27 16:44:00 -03:00
Oscar Guindzberg
e5b52fb73b
PeerSocketHandler: make first message validation explicit
2015-03-27 16:43:44 -03:00
Andreas Schildbach
2837ad581a
Make maven-javadoc-plugin print a lot less clutter.
2015-03-23 13:34:27 +01:00
Manfred Karrer
d13665c22f
Add linebreak to comment
2015-03-23 11:15:19 +01:00
Manfred Karrer
b74d1e32a2
Add readObject method to initialise listeners object which would be null in case the confidence object gets created from Serialisation
2015-03-23 10:29:47 +01:00
Carlos Lopez-Camey
b28204b6ca
Run core tests in alphabetical order
2015-03-22 10:42:37 -06:00
Carlos Lopez-Camey
4e6b544920
Create context for TestWithWallet
2015-03-22 17:07:53 +01:00
Carlos Lopez-Camey
48401a0af1
Removes deprecation warnings. In pom.xml artifactId is project.artifactId. Sha256Hash.createHash is Sha256Hash.hashTwice. LazyECPoint.getX and getY use getXCoord and getYCoord while forcing normalization.
2015-03-22 17:07:17 +01:00
Mike Hearn
275c9320ea
More plugin updates and a regen of the dep verifier list.
2015-03-22 17:05:10 +01:00
Mike Hearn
114a4b4fd1
wallettemplate/pom.xml: fix a maven deprecation warning
2015-03-22 16:50:20 +01:00
Mike Hearn
c5123a320e
Create context for WalletProtobufSerializerTest.
2015-03-22 16:48:57 +01:00
Mike Hearn
9c80c3b3b8
Update SureFire plugin.
2015-03-22 16:48:14 +01:00
Mike Hearn
16f953c6c1
Payment channels: log connection failures in NioClient
2015-03-22 16:27:29 +01:00
Mike Hearn
2fd565c366
Design doc for contexts
2015-03-21 17:23:21 +01:00
Mike Hearn
50e7e14763
Propagate context to the wallet autosave thread.
2015-03-21 17:23:12 +01:00
Mike Hearn
e3f70c6d4f
Context: add some more TODOs.
...
WalletAppKit: propagate context.
2015-03-21 17:07:45 +01:00
Mike Hearn
d03b68a109
Transaction: add alternatives for getConfidence()
2015-03-21 17:07:44 +01:00
Mike Hearn
7e9f0f47a2
Context: add TODOs and some more complete class javadocs
2015-03-21 17:07:44 +01:00
Mike Hearn
1a70f05ca7
Add a notion of an event horizon to the context. This is intended to unify the various places in the library where we want to throw data away after a tx is buried so deep it will probably never be re-orged, but which presently use different constants. The wallet will use the event horizon in future as well.
2015-03-21 17:07:44 +01:00
Mike Hearn
aae60d8391
Add NetworkParameters to the Context, and verify consistency when a context is fetched.
...
Make Wallet accept Context as a c'tor parameter and then update unit tests (which switch params very often) to create contexts when necessary.
2015-03-21 17:07:44 +01:00
Mike Hearn
0ba5f61c88
Delete broadcastBy data once a tx is buried under >100 blocks, as a memory saving. Remove TODO as the code is fairly clear these days.
2015-03-21 17:07:44 +01:00
Mike Hearn
3a9a47b67a
Don't access TransactionConfidence.broadcastBy from mixed synchronized/unsynchronized contexts. This isn't a real bug but clears an Inspector warning.
2015-03-21 17:07:44 +01:00
Mike Hearn
95dec1a910
Don't run event listener twice if a peer announces twice.
2015-03-21 17:07:44 +01:00
Mike Hearn
750f469bd3
Confidence objects now pin themselves when a listener is attached, eliminating a certain class of GC-triggered heisenbug.
2015-03-21 17:07:44 +01:00
Mike Hearn
5a824f8411
Make Context.confidenceTable private. The getter method can be overridden if a subclass wishes to modify this object.
2015-03-21 17:07:44 +01:00
Mike Hearn
04bc624a91
Rewrite TxConfidenceTable to actually track confidence objects. Make Transaction.getConfidence() fetch the object from the table via the context. This allows us to simplify large chunks of code quite considerably. Note that confidence listeners are not yet pinning the attached confidence to the root set, so the same old bugs remain if you don't pin the tx object. That will be fixed next.
2015-03-21 17:07:44 +01:00
Mike Hearn
f1d2a48a2e
Fix class javadoc in Context
2015-03-21 17:07:44 +01:00
Mike Hearn
257aacf81b
Make the Context object be a global object that is propagated between threads, and created on demand in the PeerGroup constructor. This isn't complete but is a sketch of where we might go. Context propagation is mostly auto-magical at the moment and will become less so with time, making it easier to use multiple instances of the library from the same thread simultaneously. At the moment you would potentially hit issues if using multiple instances from the same thread though and we should fix that before landing (aka don't break devrandom).
2015-03-21 17:07:43 +01:00
Mike Hearn
ece8d9a347
Perf hack for Android: cache the result of Transaction.getValue(). This won't help once we split payments from transactions.
2015-03-21 17:02:25 +01:00
Mike Hearn
8c414fb172
Script: don't query the clock when parsing a script. This actually shows up in Android performance profiles.
2015-03-21 17:02:25 +01:00
Mike Hearn
596d6f9d88
Wallet: optimise Bloom filter calculation some more, optimize calculateSpendCandidates, make watching wallets report the balance via getBalance instead of a different method.
2015-03-21 17:02:24 +01:00
Mike Hearn
40ee90cc0c
Wallet: track UTXOs explicitly and use that to try and accelerate Bloom filtering for large wallets.
2015-03-21 17:02:24 +01:00
Mike Hearn
ed3ef7d15e
Make stall threshold configurable and reset parameters to be more appropriate for most wallets.
2015-03-18 13:30:42 +01:00
Mike Hearn
f693d88620
Add JavaDocs for the new PeerGroup methods added by Oscar.
2015-03-18 12:51:29 +01:00
Oscar Guindzberg
2c5d9f73ed
Allow disabling bloom filters on the peer group without using a
...
FullPrunedBlockChain
2015-03-18 12:51:29 +01:00
Andreas Schildbach
c6ee7449c3
Adjust stall period to 15 seconds and min speed to 5 kB/s. The previous 6 seconds caused otherwise quick peers to be disconnected too often. Also, fixed a compare bug and a comment.
2015-03-15 15:34:13 +01:00
Mike Hearn
7e12da357c
Undo the memory usage optimisation for scriptPubKey parsing on Android to see if CPU time now matters more than memory (especially when combined with the wallet unspents tracking work).
2015-03-13 18:00:05 -07:00
Mike Hearn
7f14f7e491
On Android, use non-cycle detecting locks with fairness activated (experimental)
2015-03-13 17:59:24 -07:00
Andreas Schildbach
59b426afe0
Increase wallet autosave delay for wallet-tool and WalletAppKit. Since we have some recovery for out-of-sync wallets in place, we can afford to save less often.
2015-03-12 18:07:51 +01:00
Andreas Schildbach
9e4d25b2c2
Properly ignore PeerGroupTest.peerPriority().
2015-03-12 10:58:38 +01:00