@@ -943,24 +943,20 @@ bool protocol_explore::handle_get_address(const code& ec, interface::address,
943943 return true ;
944944 }
945945
946- address_handler complete = BIND (complete_get_address, _1, _2, _3);
947- PARALLEL (do_get_address, media, turbo, hash, std::move (complete));
946+ PARALLEL (do_get_address, media, turbo, hash);
948947 return true ;
949948}
950949
951950// private
952951void protocol_explore::do_get_address (uint8_t media, bool turbo,
953- const hash_cptr& hash, const address_handler& handler ) NOEXCEPT
952+ const hash_cptr& hash) NOEXCEPT
954953{
955- outpoints set{};
956- if (const auto ec = archive ().get_address_outputs (stopping_, set,
957- *hash, turbo))
958- {
959- handler (ec, {}, {});
960- return ;
961- }
954+ BC_ASSERT (!stranded ());
962955
963- handler (network::error::success, media, std::move (set));
956+ outpoints set{};
957+ const auto & query = archive ();
958+ const auto ec = query.get_address_outputs (stopping_, set, *hash, turbo);
959+ POST (complete_get_address, ec, media, std::move (set));
964960}
965961
966962// This is shared by the three get_address... methods.
@@ -1017,24 +1013,20 @@ bool protocol_explore::handle_get_address_confirmed(const code& ec,
10171013 return true ;
10181014 }
10191015
1020- address_handler complete = BIND (complete_get_address, _1, _2, _3);
1021- PARALLEL (do_get_address_confirmed, media, turbo, hash, std::move (complete));
1016+ PARALLEL (do_get_address_confirmed, media, turbo, hash);
10221017 return true ;
10231018}
10241019
10251020// private
10261021void protocol_explore::do_get_address_confirmed (uint8_t media, bool turbo,
1027- const hash_cptr& hash, const address_handler& handler ) NOEXCEPT
1022+ const hash_cptr& hash) NOEXCEPT
10281023{
1029- outpoints set{};
1030- if (const auto ec = archive ().get_confirmed_unspent_outputs (stopping_,
1031- set, *hash, turbo))
1032- {
1033- handler (ec, {}, {});
1034- return ;
1035- }
1024+ BC_ASSERT (!stranded ());
10361025
1037- handler (network::error::success, media, std::move (set));
1026+ outpoints set{};
1027+ const auto & query = archive ();
1028+ auto ec = query.get_confirmed_unspent_outputs (stopping_, set, *hash, turbo);
1029+ POST (complete_get_address, ec, media, std::move (set));
10381030}
10391031
10401032// handle_get_address_unconfirmed
@@ -1050,16 +1042,6 @@ bool protocol_explore::handle_get_address_unconfirmed(const code& ec,
10501042 // TODO: there are currently no unconfirmed txs.
10511043 send_not_implemented ();
10521044 return true ;
1053-
1054- // //address_handler complete = BIND(complete_get_address, _1, _2, _3);
1055- // //PARALLEL(do_get_address_unconfirmed, media, turbo, hash, std::move(complete));
1056- // //return true;
1057- }
1058-
1059- void protocol_explore::do_get_address_unconfirmed (uint8_t media, bool ,
1060- const system::hash_cptr&, const address_handler& handler) NOEXCEPT
1061- {
1062- handler (network::error::success, media, {});
10631045}
10641046
10651047// handle_get_address_balance
@@ -1079,31 +1061,27 @@ bool protocol_explore::handle_get_address_balance(const code& ec,
10791061 return true ;
10801062 }
10811063
1082- balance_handler complete = BIND (complete_get_address_balance, _1, _2, _3);
1083- PARALLEL (do_get_address_balance, media, turbo, hash, std::move (complete));
1064+ PARALLEL (do_get_address_balance, media, turbo, hash);
10841065 return true ;
10851066}
10861067
10871068void protocol_explore::do_get_address_balance (uint8_t media, bool turbo,
1088- const system::hash_cptr& hash, const balance_handler& handler ) NOEXCEPT
1069+ const system::hash_cptr& hash) NOEXCEPT
10891070{
1090- uint64_t balance{};
1091- if (const auto ec = archive ().get_confirmed_balance (stopping_, balance,
1092- *hash, turbo))
1093- {
1094- handler (ec, {}, {});
1095- return ;
1096- }
1071+ BC_ASSERT (!stranded ());
10971072
1098- handler (network::error::success, media, balance);
1073+ uint64_t balance{};
1074+ const auto & query = archive ();
1075+ auto ec = query.get_confirmed_balance (stopping_, balance, *hash, turbo);
1076+ POST (complete_get_address_balance, ec, media, balance);
10991077}
11001078
11011079void protocol_explore::complete_get_address_balance (const code& ec,
11021080 uint8_t media, uint64_t balance) NOEXCEPT
11031081{
11041082 BC_ASSERT (stranded ());
11051083
1106- // This suppresses the error response resulting from cancelation .
1084+ // Suppresses cancelation error response.
11071085 if (stopped ())
11081086 return ;
11091087
0 commit comments