Bitcoin Forum
May 08, 2024, 09:46:04 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Obtain the fee of CTransaction  (Read 694 times)
collapse (OP)
Full Member
***
Offline Offline

Activity: 206
Merit: 102


step forward


View Profile
November 20, 2013, 08: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?

Elacoin-ELC,Betacoin-BET,Neutroncoin-NTRN,Americancoin-AMC,Stronghands-SHND,Craftcoin-CRC,DOGE,BCH,BTC,...,Bitcoin,...(and a lot more)
Linux updated wallets (source code) for: ELC, BET, AMC, NKT, SLING, CRC,...
[if (blocknumber > 115000) maxblocksize=largerlimit]   [I don't think the threshold should ever be 0.  We should always allow at least some free transactions.]
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!