remove per_kb_fee

This commit is contained in:
j-berman 2022-05-28 18:56:26 -07:00
parent e007e6f505
commit 1f3265b541
3 changed files with 6 additions and 6 deletions

View file

@ -537,12 +537,13 @@ namespace lws
if (!resp)
return resp.error();
if ((resp->size_scale != 1 && resp->size_scale != 1024) || resp->fee_mask == 0)
if (resp->size_scale == 0 || 1024 < resp->size_scale || resp->fee_mask == 0)
return {lws::error::bad_daemon_response};
const bool use_per_byte_fee = resp->size_scale == 1;
const std::uint64_t per_byte_fee =
resp->estimated_base_fee / resp->size_scale;
return response{resp->estimated_base_fee, resp->fee_mask, rpc::safe_uint64(received), std::move(unspent), std::move(req.creds.key), use_per_byte_fee};
return response{per_byte_fee, resp->fee_mask, rpc::safe_uint64(received), std::move(unspent), std::move(req.creds.key)};
}
};

View file

@ -294,7 +294,7 @@ namespace lws
return expand_outputs{src, self.user_key};
};
wire::object(dest,
wire::field(self.use_per_byte_fee ? "per_byte_fee" : "per_kb_fee", self.base_fee),
WIRE_FIELD_COPY(per_byte_fee),
WIRE_FIELD_COPY(fee_mask),
WIRE_FIELD_COPY(amount),
wire::field("outputs", wire::as_array(std::cref(self.outputs), expand))

View file

@ -155,12 +155,11 @@ namespace rpc
struct get_unspent_outs_response
{
get_unspent_outs_response() = delete;
std::uint64_t base_fee; // either per_byte_fee or per_kb_fee
std::uint64_t per_byte_fee;
std::uint64_t fee_mask;
safe_uint64 amount;
std::vector<std::pair<db::output, std::vector<crypto::key_image>>> outputs;
crypto::secret_key user_key;
bool use_per_byte_fee;
};
void write_bytes(wire::json_writer&, const get_unspent_outs_response&);