Repository navigation
Conversation
`send --receivers "<addr>:<amount>,..."` or `--receivers_file <path>` (one "addr:amount" per line, '#' comments) starts one transaction per receiver in the same wallet session and waits until all of them finish. Mimblewimble txs have a single receiver, so a bitcoin-style sendmany output list isn't possible; coin selection and SaveCoins run in the same synchronous step per tx, so the txs never pick the same coins. Everything is checked before any tx starts: entry format, amounts, duplicate receivers, address validity, conflicting options (--amount, -r, --utxo, --slatepack), and total amount + fees vs the available balance. --fee, --asset_id and --offline apply to every tx. ReadAmount's parsing moved to ParseAmount (shared); it now also rejects nan and amounts under 1 groth (they became a 0-amount tx). Tests: wallet_cli_test (new; list and amount parsing) and TestSendToManyReceivers (two txs from one session on the test node).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix:
beam-wallet sendcan pay several receivers in one command (#364).Why / design: a Mimblewimble tx has one receiver, so there's no bitcoin-style single tx with many outputs. The command starts one tx per receiver in the same wallet session and waits until all of them finish (the CLI used to wait for exactly one). In the core, coin selection (
CompleteBalance) and coin tagging (SaveCoins) run in the same synchronous step per tx, so two txs never take the same coins.Checked before anything starts: entry format, amounts, duplicate receivers, address validity, options that can't be combined (
--amount,-r,--utxo,--slatepack), and total amount + fees against the available balance.How to see it (no node needed for the checks)
Improvement
--receivers A1:1,A2:2(empty wallet)unrecognised option '--receivers'Not enough funds: 2 transactions need 3 BEAM plus 0.000002 BEAM in fees--receivers_file payees.txt--receivers A1:1,A1:2duplicate receiver 'A1'--receivers A1/A1:0invalid receiver entry …, expected <address>:<amount>/… Unable to send zero coins--receivers A1:1 --amount 1--receivers and --receivers_file can't be combined with --receiver_addr, --amount, --utxo or --slatepackTransaction <txid> started: sending <amt> to <addr>per receiver; exits when all are doneSingle
sendis unchanged. Two small side effects of sharing the amount parser (ParseAmount): amounts under 1 groth andnanare rejected (they used to become a 0-amount tx), and an invalid--amounterror is now one line:the amount ('abc') is invalid. ….Limits: with few big coins, change from the first tx isn't spendable until it confirms, so later txs can fail with "no inputs" even though the total balance is enough. Run
splitfirst in that case. Every SBBS receiver must come online, as withsend. The txs aren't queued one after another, as suggested in the issue's comment; they start together.Testing: new
wallet_cli_test(list and amount parsing: file format, comments, malformed entries, zero, negative,1,5, duplicates, sub-groth, nan, inf) passes; with the duplicate check disabled it fails 2 checks. NewTestSendToManyReceivers(wallet_test, in-process test node) passes: one sender starts two txs back to back, both complete, each receiver gets its amount, and no coin is spent by both txs. The CLI rows above compare master and this branch. Fork CI (running): https://github.com/vsnation/beam/actions/runs/Fixes #364