-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Put locktime into FullTxOut #950
Comments
Do you mean the lock time for the transaction that the output is on or do you mean time at which this output could be spent? |
Could be both. Either the locktime fields directly from the transaction the utxo is sitting in, or the final time/height at which it becomes "spendable". Unlike coinbase, time-locked txs are in mempool. But unlike normal mempool utxos, which are spendable, we should not include them in coinselection. So they need to be filtered out via As in terms of what data to include. It can in-theory be both, the actual locktime fields from the transaction, or the final unlocking time/height. But both will need knowledge of confirmation heights somewhere to work out maturity. My personal preference would be towards putting the final unlocking time/height in Reasoning: it hides the complex part in |
Another idea: Why not just put this final maturity time/height in Benefits:
I don't know which one is more complex or simpler. Doing this way is a burden on the user to do this right. |
As per this comment #951 (comment) We can go with Idea 1. And put the final time/height of unlocking in I will make a draft implementation for it. |
Oh.. We also need to know the block-time from chainoracle at a given height to handle time-based locks. Also need the blocktime at confirmation height to handle time-based relative locks. How to do that? We can punch in these data into Anchors. But is there any other plan for handling them? cc: @evanlinjin |
I made some trials, and it seems we need the following: (More complex than I initially thought)
Does this seem like a reasonable approach? Or else open for suggestion. |
|
I agree that this can be done in another layer. Maybe at the wallet level. While ensuring we include confirmation time for the input transaction too, while doing the sync. It doesn't have to be a full Tx. Could be the Partial Tx like we store in the TxGraph. But it would require another Anchor type with |
I meant that we can't know what the |
Describe the enhancement
To calculate maturity for time-locked transactions, the lock time needs to be included in FullTxOut. #926 (comment)
This could be done in together with #945
Use case
Enchance maturity calculation.
The text was updated successfully, but these errors were encountered: