Make `ListMessage` and its subclasses "almost" immutable. When the deprecated
`addItem()`, `removeItem()`, etc. methods are removed and the constructors are
changed to create an ummodifiable `List`, they will be immutable.
The other `getConfidence()` methods in `Transaction` eventually call the one that
takes a `TxConfidenceTable`, so we call that one directly.
Also prepares for not using `Transaction` to find the `TransactionConfidence`.
This is a breaking change as `getOverridingTransaction()` has been removed with a replacement
of `getOverridingTxId()`.
Note that ProtoBuf serialization only stores the txId, so this change does not affect
serialization/deserialization.
* Inner class `BlockFileIterator` now iterates `ByteBuffer`
* `stream()` method calls `MessageSerializer.makeBlock()`
* `streamBuffers()` method makes raw `ByteBuffer` blocks available
* Add integration test `streamEntireBitcoindBlockChainAsBuffers()`
When reading blocks from the file stream use two effectively final
`byte[]` rather than reuse a single `byte[]`. This also makes the code
more readable by using more meaningful variable names.
* Replace iterator that iterates all blocks in a file list with iterator
that iterates all blocks in a single file
* Rewrite stream() to use flatMap() on a stream of blocks in a file (internally
using BlockFileIterator)
* Rewrite iterator() to use stream()
This is a step towards a standalone capability to iterate/stream the blocks
in a single .dat file. It also is a step towards higher-performance
implementations that can use multiple threads.
To be iterable, `iterator()` must be able to be called twice.
This is a breaking change, as users will no longer be able to use
`BlockFileLoader` directly as an `Iterator` and must call
`.iterator()` first. See the change in `BitcoindComparisonTool`.
Also adds tests.
Adjust the signature of these methods to match the actual behavior
and the JavaDoc.
Note: `BadWalletEncryptionKeyException` is a subclass
of `CompletionException` which is unchecked.
* New constructors and static factory methods
* Update code to use the new constructors
* Remove `public` from `@VisibleForTesting` setters where possible
Add a new constructor that provides more information about available funds, total
outputs, and fee in addition to amount missing. Use it in `Wallet.calculatFee` to
provide more information when the exception occurs.
Add `output.value` and calculated `nonDustValue` to the exceptions message
string. Provide those values to the constructor in `calculateFee`
Add a constructor to parent class that takes a message String.