diff options
| author | Alex Morcos <[email protected]> | 2017-06-14 15:15:40 -0400 |
|---|---|---|
| committer | Alex Morcos <[email protected]> | 2017-07-10 12:40:02 -0400 |
| commit | f135923ee2cf1a1a9a436626dc5b9219f8ad97da (patch) | |
| tree | adde79ee8ba6dc1a97167c2b8686b7d59654f9e4 /src/policy/fees.cpp | |
| parent | Change default fee estimation mode. (diff) | |
| download | discoin-f135923ee2cf1a1a9a436626dc5b9219f8ad97da.tar.xz discoin-f135923ee2cf1a1a9a436626dc5b9219f8ad97da.zip | |
Add RPC options for RBF, confirmation target, and conservative fee estimation.
Add support for setting each of these attributes on a per RPC call basis to sendtoaddress, sendmany, fundrawtransaction (already had RBF), and bumpfee (already had RBF and conf target).
Diffstat (limited to 'src/policy/fees.cpp')
| -rw-r--r-- | src/policy/fees.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp index 771491770..c39a2d55c 100644 --- a/src/policy/fees.cpp +++ b/src/policy/fees.cpp @@ -36,6 +36,20 @@ std::string StringForFeeReason(FeeReason reason) { return reason_string->second; } +bool FeeModeFromString(const std::string& mode_string, FeeEstimateMode& fee_estimate_mode) { + static const std::map<std::string, FeeEstimateMode> fee_modes = { + {"UNSET", FeeEstimateMode::UNSET}, + {"ECONOMICAL", FeeEstimateMode::ECONOMICAL}, + {"CONSERVATIVE", FeeEstimateMode::CONSERVATIVE}, + }; + auto mode = fee_modes.find(mode_string); + + if (mode == fee_modes.end()) return false; + + fee_estimate_mode = mode->second; + return true; +} + /** * We will instantiate an instance of this class to track transactions that were * included in a block. We will lump transactions into a bucket according to their |