Skip to content

Commit a8f470a

Browse files
Merge dashpay#6795: refactor: follow-up for bitcoin#27902 and bitcoin#23201 to remove segwit related code
7d63776 refactor: follow-up for bitcoin#27902 and bitcoin#23201 to remove segwit related code (Konstantin Akimov) Pull request description: ## Issue being fixed or feature implemented We use size of transaction instead weight. Having leftover helpers `HasInputWeight` and `GetInputWeight` could provoke an error in the future, if some new (especially backported) code will use it. If these helpers doesn't exist, freshly backported code will just get a compilation error -> a developer have a clear signal to replace "weight" to "size". Otherwise it maybe skipped and some "mock" interface used instead. ## What was done? Removed map `m_input_weights` and related setter, getter and fuzz test. ## How Has This Been Tested? Dash Core built successfully. ## Breaking Changes N/A ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone ACKs for top commit: UdjinM6: utACK 7d63776 Tree-SHA512: 0286d53f89552ec9b9081f58d40654c0e15294150bb4e1d0f20f83bb856d35cc923b34d9d64bba26f181e096d569cb1f2e9e4f15e8b0443a72cbc5a8d77ca4bd
2 parents 5f79425 + 7d63776 commit a8f470a

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

src/wallet/coincontrol.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -129,23 +129,6 @@ class CCoinControl
129129
vOutpoints.assign(setSelected.begin(), setSelected.end());
130130
}
131131

132-
void SetInputWeight(const COutPoint& outpoint, int64_t weight)
133-
{
134-
m_input_weights[outpoint] = weight;
135-
}
136-
137-
bool HasInputWeight(const COutPoint& outpoint) const
138-
{
139-
return m_input_weights.count(outpoint) > 0;
140-
}
141-
142-
int64_t GetInputWeight(const COutPoint& outpoint) const
143-
{
144-
auto it = m_input_weights.find(outpoint);
145-
assert(it != m_input_weights.end());
146-
return it->second;
147-
}
148-
149132
// Dash-specific helpers
150133
void UseCoinJoin(bool fUseCoinJoin)
151134
{
@@ -160,8 +143,6 @@ class CCoinControl
160143
private:
161144
std::set<COutPoint> setSelected;
162145
std::map<COutPoint, CTxOut> m_external_txouts;
163-
//! Map of COutPoints to the maximum weight for that input
164-
std::map<COutPoint, int64_t> m_input_weights;
165146
};
166147
} // namespace wallet
167148

src/wallet/test/fuzz/coincontrol.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,6 @@ FUZZ_TARGET(coincontrol, .init = initialize_coincontrol)
7272
[&] {
7373
std::vector<COutPoint> selected;
7474
coin_control.ListSelected(selected);
75-
},
76-
[&] {
77-
int64_t weight{fuzzed_data_provider.ConsumeIntegral<int64_t>()};
78-
(void)coin_control.SetInputWeight(out_point, weight);
79-
},
80-
[&] {
81-
// Condition to avoid the assertion in GetInputWeight
82-
if (coin_control.HasInputWeight(out_point)) {
83-
(void)coin_control.GetInputWeight(out_point);
84-
}
8575
});
8676
}
8777
}

0 commit comments

Comments
 (0)