diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-06-06 18:50:32 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-06-06 18:51:00 +0200 |
| commit | 95d68c48d7ae45cb2a7303152816e9391cfbd0c9 (patch) | |
| tree | 0a25f1f328ca66177c79afcf4422ea99d221f981 /src/core.cpp | |
| parent | Merge pull request #4297 (diff) | |
| parent | estimatefee / estimatepriority RPC methods (diff) | |
| download | discoin-95d68c48d7ae45cb2a7303152816e9391cfbd0c9.tar.xz discoin-95d68c48d7ae45cb2a7303152816e9391cfbd0c9.zip | |
Merge pull request #3959
171ca77 estimatefee / estimatepriority RPC methods (Gavin Andresen)
0193fb8 Allow multiple regression tests to run at once (Gavin Andresen)
c6cb21d Type-safe CFeeRate class (Gavin Andresen)
Diffstat (limited to 'src/core.cpp')
| -rw-r--r-- | src/core.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core.cpp b/src/core.cpp index aadcb44b9..6039986e6 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -72,6 +72,25 @@ void CTxOut::print() const LogPrintf("%s\n", ToString()); } +CFeeRate::CFeeRate(int64_t nFeePaid, size_t nSize) +{ + if (nSize > 0) + nSatoshisPerK = nFeePaid*1000/nSize; + else + nSatoshisPerK = 0; +} + +int64_t CFeeRate::GetFee(size_t nSize) +{ + return nSatoshisPerK*nSize / 1000; +} + +std::string CFeeRate::ToString() const +{ + std::string result = FormatMoney(nSatoshisPerK) + " BTC/kB"; + return result; +} + uint256 CTransaction::GetHash() const { return SerializeHash(*this); |