Commit 905c8dd
committed
fix(wallet): off-by-one error checking coinbase maturity in optional UTxOs
The `preselect_utxos` method (now `filter_utxos`) had an off-by-one
error that was making the selection of optional UTxOs too restrictive,
by requiring the coinbase outputs to surpass or equal coinbase maturity
time at the current height of the selection, and not in the block in
which the transaction may be included in the blockchain (be spent),
probably, the next one.
The bug is still in `filter_utxos`.
The changes in this commit fix it by making use of the correctly defined
`FullTxOut<A>::is_mature` method, which test positively a UTxO as mature
if it is elegible for inclusion in the next mined block.1 parent 9c6ce71 commit 905c8dd
2 files changed
Lines changed: 26 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
2010 | 2010 | | |
2011 | 2011 | | |
2012 | 2012 | | |
2013 | | - | |
| 2013 | + | |
| 2014 | + | |
2014 | 2015 | | |
2015 | | - | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
2016 | 2029 | | |
2017 | 2030 | | |
2018 | 2031 | | |
| |||
2027 | 2040 | | |
2028 | 2041 | | |
2029 | 2042 | | |
2030 | | - | |
2031 | | - | |
2032 | | - | |
2033 | | - | |
2034 | | - | |
2035 | | - | |
2036 | | - | |
2037 | | - | |
2038 | | - | |
2039 | | - | |
2040 | | - | |
2041 | | - | |
2042 | | - | |
2043 | | - | |
2044 | | - | |
2045 | | - | |
2046 | | - | |
2047 | 2043 | | |
2048 | 2044 | | |
2049 | 2045 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3875 | 3875 | | |
3876 | 3876 | | |
3877 | 3877 | | |
3878 | | - | |
3879 | | - | |
| 3878 | + | |
| 3879 | + | |
| 3880 | + | |
| 3881 | + | |
| 3882 | + | |
| 3883 | + | |
| 3884 | + | |
| 3885 | + | |
| 3886 | + | |
| 3887 | + | |
3880 | 3888 | | |
3881 | 3889 | | |
3882 | 3890 | | |
| |||
0 commit comments