@@ -110,6 +110,12 @@ uint32_t get_fee(const void *this_arg, LDKConfirmationTarget target) {
110
110
}
111
111
// Note that we don't call _free() on target, but that's OK, its unitary
112
112
}
113
+ // We use the same fee estimator globally:
114
+ const LDKFeeEstimator fee_est {
115
+ .this_arg = NULL ,
116
+ .get_est_sat_per_1000_weight = get_fee,
117
+ .free = NULL ,
118
+ };
113
119
114
120
static int num_txs_broadcasted = 0 ; // Technically a race, but ints are atomic on x86
115
121
void broadcast_tx (const void *this_arg, LDKTransaction tx) {
@@ -159,7 +165,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_monitor(const void *this_
159
165
LDKBroadcasterInterface broadcaster = {
160
166
.broadcast_transaction = broadcast_tx,
161
167
};
162
- LDK::CResult_NoneMonitorUpdateErrorZ res = ChannelMonitor_update_monitor (&mon.second , &update, &broadcaster, arg->logger );
168
+ LDK::CResult_NoneMonitorUpdateErrorZ res = ChannelMonitor_update_monitor (&mon.second , &update, &broadcaster, &fee_est, arg->logger );
163
169
assert (res->result_ok );
164
170
}
165
171
}
@@ -224,12 +230,6 @@ int main() {
224
230
LDKNetwork network = LDKNetwork_Testnet;
225
231
226
232
// Trait implementations:
227
- LDKFeeEstimator fee_est {
228
- .this_arg = NULL ,
229
- .get_est_sat_per_1000_weight = get_fee,
230
- .free = NULL ,
231
- };
232
-
233
233
LDKBroadcasterInterface broadcast {
234
234
.this_arg = NULL ,
235
235
.broadcast_transaction = broadcast_tx,
0 commit comments