mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Add explicit fee field to transaction
This commit is contained in:
parent
fc86bc95c2
commit
b8264355f1
32 changed files with 705 additions and 666 deletions
|
|
@ -153,6 +153,13 @@ TestChain100Setup::~TestChain100Setup()
|
|||
}
|
||||
|
||||
|
||||
CAmount TotalValueOut(const CMutableTransaction& tx) {
|
||||
CAmount nTotal = 0;
|
||||
BOOST_FOREACH(const CTxOut& txo, tx.vout)
|
||||
nTotal += txo.nValue;
|
||||
return nTotal;
|
||||
}
|
||||
|
||||
CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(const CMutableTransaction &tx, CTxMemPool *pool) {
|
||||
CTransaction txn(tx);
|
||||
return FromTx(txn, pool);
|
||||
|
|
@ -160,7 +167,7 @@ CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(const CMutableTransaction &tx, CT
|
|||
|
||||
CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(const CTransaction &txn, CTxMemPool *pool) {
|
||||
// Hack to assume either it's completely dependent on other mempool txs or not at all
|
||||
CAmount inChainValue = pool && pool->HasNoInputsOf(txn) ? txn.GetValueOut() : 0;
|
||||
CAmount inChainValue = pool && pool->HasNoInputsOf(txn) ? TotalValueOut(txn) : 0;
|
||||
|
||||
return CTxMemPoolEntry(MakeTransactionRef(txn), nFee, nTime, dPriority, nHeight,
|
||||
inChainValue, spendsCoinbase, sigOpCost, lp, setWithdrawsSpent);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue