mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
MOVEONLY: Move CFeeRate and Amount constants to amount.o
This commit is contained in:
parent
b6c99efe9c
commit
eda3733091
13 changed files with 82 additions and 65 deletions
23
src/core.cpp
23
src/core.cpp
|
|
@ -59,29 +59,6 @@ std::string CTxOut::ToString() const
|
|||
return strprintf("CTxOut(nValue=%d.%08d, scriptPubKey=%s)", nValue / COIN, nValue % COIN, scriptPubKey.ToString().substr(0,30));
|
||||
}
|
||||
|
||||
CFeeRate::CFeeRate(const CAmount& nFeePaid, size_t nSize)
|
||||
{
|
||||
if (nSize > 0)
|
||||
nSatoshisPerK = nFeePaid*1000/nSize;
|
||||
else
|
||||
nSatoshisPerK = 0;
|
||||
}
|
||||
|
||||
CAmount CFeeRate::GetFee(size_t nSize) const
|
||||
{
|
||||
CAmount nFee = nSatoshisPerK*nSize / 1000;
|
||||
|
||||
if (nFee == 0 && nSatoshisPerK > 0)
|
||||
nFee = nSatoshisPerK;
|
||||
|
||||
return nFee;
|
||||
}
|
||||
|
||||
std::string CFeeRate::ToString() const
|
||||
{
|
||||
return strprintf("%d.%08d BTC/kB", nSatoshisPerK / COIN, nSatoshisPerK % COIN);
|
||||
}
|
||||
|
||||
CMutableTransaction::CMutableTransaction() : nVersion(CTransaction::CURRENT_VERSION), nLockTime(0) {}
|
||||
CMutableTransaction::CMutableTransaction(const CTransaction& tx) : nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout), nLockTime(tx.nLockTime) {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue