diff options
author | Alex Morcos <morcos@chaincode.com> | 2015-11-13 10:05:21 -0500 |
---|---|---|
committer | Alex Morcos <morcos@chaincode.com> | 2015-11-19 21:44:35 -0500 |
commit | c0353064ddf71ad103bd19f6e7c10ff8e240ac46 (patch) | |
tree | 9fec6d8c6ddb79925d90b2d12582e2dee3380de6 /src/coins.h | |
parent | 71f1d9fd4ae2c2fc90d5487bdf2096f9eb5898d9 (diff) |
Change GetPriority calculation.
Compute the value of inputs that already are in the chain at time of mempool entry and only increase priority due to aging for those inputs. This effectively changes the CTxMemPoolEntry's GetPriority calculation from an upper bound to a lower bound.
Diffstat (limited to 'src/coins.h')
-rw-r--r-- | src/coins.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/coins.h b/src/coins.h index 99b25de45b..d174422100 100644 --- a/src/coins.h +++ b/src/coins.h @@ -456,8 +456,12 @@ public: //! Check whether all prevouts of the transaction are present in the UTXO set represented by this view bool HaveInputs(const CTransaction& tx) const; - //! Return priority of tx at height nHeight - double GetPriority(const CTransaction &tx, int nHeight) const; + /** + * Return priority of tx at height nHeight. Also calculate the sum of the values of the inputs + * that are already in the chain. These are the inputs that will age and increase priority as + * new blocks are added to the chain. + */ + double GetPriority(const CTransaction &tx, int nHeight, CAmount &inChainInputValue) const; const CTxOut &GetOutputFor(const CTxIn& input) const; |