MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetFee

Method GetFee

src/policy/feerate.cpp:23–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23CAmount CFeeRate::GetFee(uint32_t num_bytes) const
24{
25 const int64_t nSize{num_bytes};
26
27 // Be explicit that we're converting from a double to int64_t (CAmount) here.
28 // We've previously had issues with the silent double->int64_t conversion.
29 CAmount nFee{static_cast<CAmount>(std::ceil(nSatoshisPerK * nSize / 1000.0))};
30
31 if (nFee == 0 && nSize != 0) {
32 if (nSatoshisPerK > 0) nFee = CAmount(1);
33 if (nSatoshisPerK < 0) nFee = CAmount(-1);
34 }
35
36 return nFee;
37}
38
39std::string CFeeRate::ToString(const FeeEstimateMode& fee_estimate_mode) const
40{

Callers 15

operator()Method · 0.80
addUncheckedMethod · 0.80
removeUncheckedMethod · 0.80
checkMethod · 0.80
GetInfoFunction · 0.80
SendMessagesMethod · 0.80
AcceptPackageMethod · 0.80
PaysForRBFFunction · 0.80
GetDustThresholdFunction · 0.80
processTransactionMethod · 0.80
processBlockTxMethod · 0.80

Calls

no outgoing calls

Tested by 3

TestPackageSelectionMethod · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64
FUZZ_TARGETFunction · 0.64