mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-08-05 14:34:49 +02:00
core_io: Add ValueFromFeeRate helper
This commit is contained in:
parent
09c51e7f7d
commit
8baf00e0c4
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
class CBlock;
|
class CBlock;
|
||||||
class CBlockHeader;
|
class CBlockHeader;
|
||||||
|
class CFeeRate;
|
||||||
class CScript;
|
class CScript;
|
||||||
class CTransaction;
|
class CTransaction;
|
||||||
struct CMutableTransaction;
|
struct CMutableTransaction;
|
||||||
@ -50,6 +51,7 @@ bool ParseHashStr(const std::string& strHex, uint256& result);
|
|||||||
|
|
||||||
// core_write.cpp
|
// core_write.cpp
|
||||||
UniValue ValueFromAmount(const CAmount amount);
|
UniValue ValueFromAmount(const CAmount amount);
|
||||||
|
UniValue ValueFromFeeRate(const CFeeRate& fee_rate);
|
||||||
std::string FormatScript(const CScript& script);
|
std::string FormatScript(const CScript& script);
|
||||||
std::string EncodeHexTx(const CTransaction& tx);
|
std::string EncodeHexTx(const CTransaction& tx);
|
||||||
std::string SighashToStr(unsigned char sighash_type);
|
std::string SighashToStr(unsigned char sighash_type);
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include <consensus/consensus.h>
|
#include <consensus/consensus.h>
|
||||||
#include <consensus/validation.h>
|
#include <consensus/validation.h>
|
||||||
#include <key_io.h>
|
#include <key_io.h>
|
||||||
|
#include <policy/feerate.h>
|
||||||
#include <script/descriptor.h>
|
#include <script/descriptor.h>
|
||||||
#include <script/script.h>
|
#include <script/script.h>
|
||||||
#include <script/solver.h>
|
#include <script/solver.h>
|
||||||
@ -36,6 +37,11 @@ UniValue ValueFromAmount(const CAmount amount)
|
|||||||
strprintf("%s%d.%08d", amount < 0 ? "-" : "", quotient, remainder));
|
strprintf("%s%d.%08d", amount < 0 ? "-" : "", quotient, remainder));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UniValue ValueFromFeeRate(const CFeeRate& fee_rate)
|
||||||
|
{
|
||||||
|
return UniValue(UniValue::VNUM, fee_rate.SatsToString());
|
||||||
|
}
|
||||||
|
|
||||||
std::string FormatScript(const CScript& script)
|
std::string FormatScript(const CScript& script)
|
||||||
{
|
{
|
||||||
std::string ret;
|
std::string ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user