This issue deals with spending sources with lock conditions, right ? Not with sending transactions with lock conditions ?
Or both ?
For unlocking sources, I think we should :
create a "unlock" feature that sends all possible sources locked with CSV(), CLTV(), XHX() to the account, with the only SIG() condition.
modify the source selection algorithm so that CSV() and CLTV() are used as early as possible.
For sending locked outputs, I thinl we should create a "lock" feature, with sub-options :
"--password PASSWORD",
"--date YY-MM-DD-HH:MM",
"--delay NUMBER:hour/day/month/year" with default on days.
Moulchanged title from Add ability to send transaction with XHX, CSV, CLTV unlock conditions to Add ability to unlock and lock transaction with XHX, CSV, CLTV conditions
changed title from Add ability to send transaction with XHX, CSV, CLTV unlock conditions to Add ability to unlock and lock transaction with XHX, CSV, CLTV conditions
There is still work to be done on the display, but it works. Available CSV and CLTV sources are automatically handled on normal transactions.
However, I think we should modify the "balance" display : if there are locked sources on the account, the display should look like :
Blockchain:-----------Relative = 0.73 UD ĞTestQuantitative = 2100.0 ĞTestPending Transaction:--------------------Relative = 0.48 UD ĞTestQuantitative = 1400.0 ĞTestLocked amount :---------------Relative = 1 UD ĞTestQuantitative= X ĞTestAvailable amount :------------------Relative =Quantitative=Total amount of: 3i7jBZz1bYVTtao3C6e7cN21JHYjHCDR9pKeReE4rdVe-------------------------------------------------------------Total Relative = 1.21 UD ĞTestTotal Quantitative = 3500.0 ĞTestTotal Relative to average money share = 0.01 × M/NTotal Relative to monetary mass = 0.082 % M
For lightness and consistency with the transaction_confirmation() display, it might also be :
╒══════════════════════════════╤══════════════════════════════════════════════╕| Available balance | 1000.0 ĞTest | 0.48 UD ĞTest |├──────────────────────────────┼──────────────────────────────────────────────┤│ Blockchain │ 900.0 ĞTest | 0.45 UD ĞTest │├──────────────────────────────┼──────────────────────────────────────────────┤│ Pending │ 100.0 ĞTest | 0.05 UD ĞTest │├──────────────────────────────┼──────────────────────────────────────────────┤│ Locked │ 400.0 ĞTest | 0.2 UD ĞTest │├──────────────────────────────┼──────────────────────────────────────────────┤│ Total balance │ 1400.0 ĞTest | 0.4848 UD ĞTest │├──────────────────────────────┼──────────────────────────────────────────────┤│ Total (relative to M/N) │ 0.01 x M/N │├──────────────────────────────┼──────────────────────────────────────────────┤│ Total (relative to M) │ 0.008 % M │╘══════════════════════════════╧══════════════════════════════════════════════╛
with fields "Available" and "Locked" not displayed if no locked sources.
A question about the design of the architecture of this feature.
Why are you adding a new unlock command?
Why not implementing this in the current tx command? Can you explain your reasons. Sending a transaction is anyway unlocking money sources even with a signature locker SIG().
SIG() only "money that only I can spend right now"
SIG() && CSV() (or CLTV) "money that only I can spend after a certain time"
SIG() || SIG(other) && CSV(1_year) "money that I can spend now, or another after a year"
Unlock feature is thought as "send all unlockable sources to myself". The receiver might not want to spend the money to other people. As a receiver, I might want to use the source as early as possible.
However, we may simply add a --unlock option to tx. This would do :
# Spend all usable complex conditions with SIG AND (CSV or CLTV) to myself silkaj tx --unlock# Spend all usable complex conditions with SIG AND (CSV or CLTV or XHX) to myself silkaj tx --unlock--passwords 3:14159# Spend all usable complex conditions with SIG AND (CSV or CLTV or XHX) for a transaction, and use SIG only sources if necessary silkaj tx --unlock--passwords 3:14159 --output <receiver> --amount <amount># Spend all usable complex conditions with SIG, CSV, CLTV for a transaction, and use SIG only sources if necessary # I think all available CSV() and CLTV() sources should be spend as early as possible. silkaj tx --output <receiver> --amount <amount> silkaj tx --unlock--output <receiver> --amount <amount>
I think this is more elegant and understandable than separate tx and unlock features. Thanks for the comment !