3333namespace libbitcoin {
3434namespace database {
3535
36- // static/private
37- TEMPLATE
38- constexpr size_t CLASS::virtual_size (size_t light, size_t heavy) NOEXCEPT
39- {
40- using namespace system ;
41- using namespace system ::chain;
42- constexpr auto scale = base_size_contribution + total_size_contribution;
43-
44- const auto weight = ceilinged_add (
45- ceilinged_multiply (base_size_contribution, light),
46- ceilinged_multiply (total_size_contribution, heavy));
47-
48- // Block weight is 3 * nominal size * + 1 * witness size [bip141].
49- return ceilinged_divide (weight, scale);
50- }
51-
5236TEMPLATE
5337bool CLASS::get_tx_virtual_size (size_t & out,
5438 const tx_link& link) const NOEXCEPT
@@ -57,7 +41,7 @@ bool CLASS::get_tx_virtual_size(size_t& out,
5741 if (!get_tx_sizes (light, heavy, link))
5842 return false ;
5943
60- out = virtual_size (light, heavy);
44+ out = system::chain:: virtual_size (light, heavy);
6145 return true ;
6246}
6347
@@ -69,7 +53,7 @@ bool CLASS::get_block_virtual_size(size_t& out,
6953 if (!get_block_sizes (light, heavy, link))
7054 return false ;
7155
72- out = virtual_size (light, heavy);
56+ out = system::chain:: virtual_size (light, heavy);
7357 return true ;
7458}
7559
0 commit comments