Author

Topic: Obtain the fee of CTransaction (Read 710 times)

full member
Activity: 206
Merit: 102
step forward
November 20, 2013, 03:57:25 PM
#1

How to obtain fee of CTransaction?

Code:
CTransaction tx;
// tx.vout[0].nValue = 111100000000;
CCoinsViewCache viewNew(*pcoinsTip, true);
int64_t txFee = viewNew.GetValueIn(tx)-GetValueOut(tx); // Fail


Error: coins.cpp:147: const CTxOut& CCoinsViewCache::GetOutputFor(const CTxIn&): coins.IsAvailable(input.prevout.n) => !vout[0].IsNull() is false => vout[0].nValue=-1

Any suggestion?
Jump to: