Skip to content

Commit 67a8241

Browse files
authored
Merge pull request #630 from evoskuil/master
Move to_integer to system, comments.
2 parents a67e6d6 + 98dc3b0 commit 67a8241

1 file changed

Lines changed: 1 addition & 25 deletions

File tree

src/protocols/protocol_electrum.cpp

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -118,28 +118,6 @@ bool protocol_electrum::handle_event(const code&, node::chase event_,
118118
// Utility.
119119
// ----------------------------------------------------------------------------
120120

121-
// TODO: move to system/math.
122-
template <typename Integer, if_integer<Integer> = true>
123-
bool to_integer(Integer& out, double value) NOEXCEPT
124-
{
125-
if (!std::isfinite(value))
126-
return false;
127-
128-
double integral{};
129-
const double fractional = std::modf(value, &integral);
130-
if (fractional != 0.0)
131-
return false;
132-
133-
if (integral > static_cast<double>(system::maximum<Integer>) ||
134-
integral < static_cast<double>(system::minimum<Integer>))
135-
return false;
136-
137-
BC_PUSH_WARNING(NO_STATIC_CAST)
138-
out = static_cast<Integer>(integral);
139-
BC_POP_WARNING()
140-
return true;
141-
}
142-
143121
// TODO: centralize in server (also used in bitcoind and native interfaces).
144122
template <typename Object, typename ...Args>
145123
std::string to_hex(const Object& object, size_t size, Args&&... args) NOEXCEPT
@@ -309,9 +287,7 @@ void protocol_electrum::handle_blockchain_estimate_fee(const code& ec,
309287
if (stopped(ec))
310288
return;
311289

312-
// TODO: estimate fees from blocks based on expected block inclusion.
313-
// TODO: this can be computed from recent blocks and cached by the server.
314-
// TODO: update the cache before broadcasting header notifications.
290+
// TODO: mode argument added in 1.6.
315291
send_result(number, 70, BIND(complete, _1));
316292
}
317293

0 commit comments

Comments
 (0)