This patch introduces an improvement to commit cbe749813 (automatic change
address selection)
Instead of supplying a Seed ID + address type, users may now specify the
address type alone. If the tracking wallet contains more than one unused
address matching the user’s criteria, the user is prompted to choose a specific
change address.
As with plain auto change address selection, this feature is entirely opt-in.
Sample invocations:
# old invocation:
$ mmgen-txcreate -q 35N9FntsNwy98TmjFHyCpsBVDVUs5wDPfB,0.123 01ABCDEF:B
# new invocation:
$ mmgen-txcreate -q 35N9FntsNwy98TmjFHyCpsBVDVUs5wDPfB,0.123 B
# or, alternatively:
$ mmgen-txcreate -q 35N9FntsNwy98TmjFHyCpsBVDVUs5wDPfB,0.123 bech32
Testing/demo:
# run the regtest test partially, leaving the coin daemon running:
$ test/test.py -D regtest.auto_chg
# run the auto chg addrtype test, displaying script output:
$ test/test.py -SAe regtest:bob_auto_chg_addrtype1
# view the addresses in Bob’s tracking wallet, verifying that the first
# unused ones in each grouping were chosen as change outputs:
$ PYTHONPATH=. MMGEN_TEST_SUITE=1 cmds/mmgen-tool --bob listaddresses interactive=1
# When finished, gracefully shut down the daemon:
$ test/stop-coin-daemons.py btc_rt
Instead of selecting a specific change address, i.e. '01ABCDEF:B:7', users can
now omit the address index, specifying '01ABCDEF:B' instead, and the script
will automatically choose the first unused address in the tracking wallet
matching the requested seed ID and address type.
This feature is entirely opt-in. Existing behavior continues to be supported
without alteration.
Sample invocations:
# old invocation:
$ mmgen-txcreate -q 35N9FntsNwy98TmjFHyCpsBVDVUs5wDPfB,0.123 01ABCDEF:S:7
# new invocation:
$ mmgen-txcreate -q 35N9FntsNwy98TmjFHyCpsBVDVUs5wDPfB,0.123 01ABCDEF:S
Testing/demo:
# run the regtest test partially, leaving the coin daemon running:
$ test/test.py -Dn regtest.view
# run the 'auto_chg' test group, displaying script output:
$ test/test.py -DSAe regtest.auto_chg
# view the addresses in Bob’s tracking wallet, verifying that the first
# unused ones in each grouping were chosen as change outputs:
$ PYTHONPATH=. MMGEN_TEST_SUITE=1 cmds/mmgen-tool --bob listaddresses interactive=1
# When finished, gracefully shut down the daemon:
$ test/stop-coin-daemons.py btc_rt
- reimplemented using the new tracking wallet display framework
- command is now interactive, with the same UI as 'twview' and 'txhist'
- the new 'Used' column shows whether an address has received funds
- the new tristate 'showused' filter allows display of only unused, used
or all used addresses
- adding, removal and editing of labels is supported
Testing/demo:
# Run the regtest test partially, leaving coin daemon running:
$ test/test.py -De regtest.label
# Try out the interactive sorting, filtering and label editing features:
$ PYTHONPATH=. MMGEN_TEST_SUITE=1 cmds/mmgen-tool --bob listaddresses interactive=1
# When finished, gracefully shut down the daemon:
$ test/stop-coin-daemons.py btc_rt