Commit c4a3b8c
committed
Merge #393: refactor(wallet)!: Remove
1854b8e cleanup(wallet)!: remove cancel_tx function (Steve Myers)
Pull request description:
### Description
Per discussion in team chat today I'm removing the `Wallet::cancel_tx` function because it's name is misleading and the `Wallet::mark_unused` function can be used to accomplish the same function.
closes #326 and closes #212 and closes #41
### Notes to the reviewers
This is an example of how to use `mark_unused` instead of `cancel_tx`
```rust
/// This marks as unused the change addresses used when creating a tx so they can be used in future transactions.
for txout in &tx.output {
if let Some((keychain, index)) = txout_index.index_of_spk(txout.script_pubkey.clone()) {
// NOTE: unmark_used will **not** make something unused if it has actually been used
// by a tx in the tracker. It only removes the superficial marking.
wallet.unmark_used(*keychain, *index);
}
}
```
### Changelog notice
- BREAKING: Remove Wallet::cancel_tx function. Use Wallet::unmark_used instead
### Checklists
#### All Submissions:
* [x] I've signed all my commits
* [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
* [x] I ran `just p` before pushing
#### Bugfixes:
* [x] This pull request breaks the existing API
* [ ] I've added tests to reproduce the issue which are now passing
* [x] I'm linking the issue being fixed by this PR
ACKs for top commit:
ValuedMammal:
ACK 1854b8e
Tree-SHA512: c5fe988c61591267ce4c96fa005355d30a24c006431e60b276ab4a18c0a7be336a53f6c9800b43ab3e915dcb5c1847827e624854c56c14039caf54df4d456758Wallet::cancel_tx function2 files changed
Lines changed: 0 additions & 86 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1965 | 1965 | | |
1966 | 1966 | | |
1967 | 1967 | | |
1968 | | - | |
1969 | | - | |
1970 | | - | |
1971 | | - | |
1972 | | - | |
1973 | | - | |
1974 | | - | |
1975 | | - | |
1976 | | - | |
1977 | | - | |
1978 | | - | |
1979 | | - | |
1980 | | - | |
1981 | | - | |
1982 | | - | |
1983 | 1968 | | |
1984 | 1969 | | |
1985 | 1970 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2768 | 2768 | | |
2769 | 2769 | | |
2770 | 2770 | | |
2771 | | - | |
2772 | | - | |
2773 | | - | |
2774 | | - | |
2775 | | - | |
2776 | | - | |
2777 | | - | |
2778 | | - | |
2779 | | - | |
2780 | | - | |
2781 | | - | |
2782 | | - | |
2783 | | - | |
2784 | | - | |
2785 | | - | |
2786 | | - | |
2787 | | - | |
2788 | | - | |
2789 | | - | |
2790 | | - | |
2791 | | - | |
2792 | | - | |
2793 | | - | |
2794 | | - | |
2795 | | - | |
2796 | | - | |
2797 | | - | |
2798 | | - | |
2799 | | - | |
2800 | | - | |
2801 | | - | |
2802 | | - | |
2803 | | - | |
2804 | | - | |
2805 | | - | |
2806 | | - | |
2807 | | - | |
2808 | | - | |
2809 | | - | |
2810 | | - | |
2811 | | - | |
2812 | | - | |
2813 | | - | |
2814 | | - | |
2815 | | - | |
2816 | | - | |
2817 | | - | |
2818 | | - | |
2819 | | - | |
2820 | | - | |
2821 | | - | |
2822 | | - | |
2823 | | - | |
2824 | | - | |
2825 | | - | |
2826 | | - | |
2827 | | - | |
2828 | | - | |
2829 | | - | |
2830 | | - | |
2831 | | - | |
2832 | | - | |
2833 | | - | |
2834 | | - | |
2835 | | - | |
2836 | | - | |
2837 | | - | |
2838 | | - | |
2839 | | - | |
2840 | | - | |
2841 | | - | |
2842 | 2771 | | |
2843 | 2772 | | |
2844 | 2773 | | |
| |||
0 commit comments