How to obtain fee of CTransaction?
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?