@@ -85,34 +85,6 @@ namespace fc {
85
85
void startApi (const node::Config &config,
86
86
NodeObjects &node_objects,
87
87
const Metrics &metrics) {
88
- // Network API
89
- PeerInfo api_peer_info{
90
- node_objects.host ->getPeerInfo ().id ,
91
- nonZeroAddrs (node_objects.host ->getAddresses (), &config.localIp ())};
92
- node_objects.api ->NetAddrsListen =
93
- [api_peer_info]() -> outcome::result<PeerInfo> {
94
- return api_peer_info;
95
- };
96
- node_objects.api ->NetConnect = [&](auto &peer) {
97
- node_objects.host ->connect (peer);
98
- return outcome::success ();
99
- };
100
- node_objects.api ->NetPeers =
101
- [&]() -> outcome::result<std::vector<PeerInfo>> {
102
- const auto &peer_repository = node_objects.host ->getPeerRepository ();
103
- auto connections = node_objects.host ->getNetwork ()
104
- .getConnectionManager ()
105
- .getConnections ();
106
- std::vector<PeerInfo> result;
107
- for (const auto &conncection : connections) {
108
- const auto remote = conncection->remotePeer ();
109
- if (remote.has_error ())
110
- log ()->error (" get remote peer error" , remote.error ().message ());
111
- result.push_back (peer_repository.getPeerInfo (remote.value ()));
112
- }
113
- return result;
114
- };
115
-
116
88
// Market Client API
117
89
node_objects.api ->ClientImport =
118
90
[&](auto &file_ref) -> outcome::result<ImportRes> {
@@ -123,7 +95,7 @@ namespace fc {
123
95
return ImportRes{root, 0 };
124
96
};
125
97
126
- node_objects.api ->ClientListDeals = [api_peer_info, &node_objects]()
98
+ node_objects.api ->ClientListDeals = [&node_objects]()
127
99
-> outcome::result<std::vector<StorageMarketDealInfo>> {
128
100
std::vector<StorageMarketDealInfo> result;
129
101
OUTCOME_TRY (local_deals,
@@ -145,7 +117,7 @@ namespace fc {
145
117
{},
146
118
deal.client_deal_proposal .proposal .verified ,
147
119
// TODO (a.chernyshov) actual ChannelId
148
- {api_peer_info. id , deal.miner .id , 0 },
120
+ {node_objects. host -> getId () , deal.miner .id , 0 },
149
121
// TODO (a.chernyshov) actual data transfer
150
122
{0 , 0 , deal.proposal_cid , true , true , " " , " " , deal.miner .id , 0 }});
151
123
}
0 commit comments