`checkArgument` should not throw with an empty seeds list _if_ running on RegTest.
The test is disabled because it requires a RegTest node that is advanced
1 block (typically via `generateblocktoaddres`) during the course of the test.
This change:
1. Shortens the code by 5 lines while adding many comments
2. Separates output to System.out from the async wait handling
3. Separates wallet/peerGroup setup and starting from async wait handling
4. Passes wait condition (along with wait-type enum) as a parameter
Behavior should be unchanged with the exception that the balance will
be output in the case that it "already meets the given condition".
This adds a test for and fixes issue #2063.
The changes do the following:
1. Build a preliminary list of candidate UTXOs.
2. Use the preliminary list to fix unconnected/valueless inputs before
calculating `valueNeeded`.
3. Create a new candidate list without the UTXOs that were already present
in inputs and use it as input for generating the `CoinSelection`.
Test changes:
1. Update existing test to show the improvement (i.e. no wasted fee).
2. Add a new test (based on PR #3055) that shows no duplicate inputs.
This work is based on changes by @michael-swiggs in PR #3055.
Note that this changes behavior slightly. We are now warning on inputs with null value
and skipping inputs with no value in the sum. Previously we were checking for non-null
getConnectedOutput(). I reviewed the code and whenever getConnectedOutput() is non-null,
getValue() should also be non-null. There might be cases where we have a value and
no connected output, but in those cases I think we should use the value.
Without this fix (and code cleanup) the `OP_RETURN` limit is not
enforced when `ensureMinRequiredFee` is false or `emptyWallet` is true.
Parameterize `twoOpReturnsPerTransactionTest()` to test all combinations
of `ensureMinRequiredFee` and `emptyWallet`.
The current implementation is based on plain P2SH. I assume as of
today one would prefer an implementation based on taproot or at least
segwit (P2WSH).
Note the `isFollowing` and `sigsRequiredToSpend` fields in the
`DeterministicKey` message of the wallet protobuf are preserved for
now, because they might come in handy for a future implementation and
in general it's hard to remove fields from protobufs.
Also removes the `marry` action from `WalletTool`.