use prev credits in tracing

This commit is contained in:
Robert Habermeier 2017-03-23 14:38:32 +01:00
parent 54eb575000
commit 1485dd07ae

View File

@ -309,11 +309,12 @@ impl LightProtocol {
}
// compute and deduct cost.
let pre_creds = creds.current();
let cost = params.compute_cost_multi(requests.requests());
creds.deduct_cost(cost)?;
trace!(target: "pip", "requesting from peer {}. Cost: {}; Available: {}",
peer_id, cost, creds.current());
peer_id, cost, pre_creds);
let req_id = ReqId(self.req_id.fetch_add(1, Ordering::SeqCst));
io.send(*peer_id, packet::REQUEST, {