Browse Source

test

pull/4/head
jl777 8 years ago
parent
commit
47658758e1
  1. 5
      src/rpcblockchain.cpp
  2. 8
      src/wallet/rpcwallet.cpp
  3. 2
      src/wallet/wallet.cpp

5
src/rpcblockchain.cpp

@ -452,14 +452,11 @@ Value gettxout(const Array& params, bool fHelp)
else ret.push_back(Pair("confirmations", pindex->nHeight - coins.nHeight + 1));
ret.push_back(Pair("value", ValueFromAmount(coins.vout[n].nValue)));
it = mapBlockIndex.find(hash);
if ( (pindex= it->second) != 0 )
{
uint64_t interest;
interest = komodo_interest(coins.vout[n].nValue,coins.nLockTime,pindex->nTime);
fprintf(stderr,"nValue %llu lock.%u nTime.%u -> %llu\n",(long long)coins.vout[n].nValue,coins.nLockTime,pindex->nTime,(long long)interest);
ret.push_back(Pair("interest", ValueFromAmount(interest)));
}
Object o;
ScriptPubKeyToJSON(coins.vout[n].scriptPubKey, o, true);
ret.push_back(Pair("scriptPubKey", o));

8
src/wallet/rpcwallet.cpp

@ -610,7 +610,7 @@ Value getreceivedbyaddress(const Array& params, bool fHelp)
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
if (txout.scriptPubKey == scriptPubKey)
if (wtx.GetDepthInMainChain() >= nMinDepth)
nAmount += txout.nValue;
nAmount += txout.nValue; // komodo_interest?
}
return ValueFromAmount(nAmount);
@ -666,7 +666,7 @@ Value getreceivedbyaccount(const Array& params, bool fHelp)
CTxDestination address;
if (ExtractDestination(txout.scriptPubKey, address) && IsMine(*pwalletMain, address) && setAddress.count(address))
if (wtx.GetDepthInMainChain() >= nMinDepth)
nAmount += txout.nValue;
nAmount += txout.nValue; // komodo_interest?
}
}
@ -1140,7 +1140,7 @@ Value ListReceived(const Array& params, bool fByAccounts)
continue;
tallyitem& item = mapTally[address];
item.nAmount += txout.nValue;
item.nAmount += txout.nValue; // komodo_interest?
item.nConf = min(item.nConf, nDepth);
item.txids.push_back(wtx.GetHash());
if (mine & ISMINE_WATCH_ONLY)
@ -2893,7 +2893,7 @@ CAmount getBalanceTaddr(std::string transparentAddress, int minDepth=1) {
}
}
CAmount nValue = out.tx->vout[out.i].nValue;
CAmount nValue = out.tx->vout[out.i].nValue; // komodo_interest
balance += nValue;
}
return balance;

2
src/wallet/wallet.cpp

@ -1312,7 +1312,7 @@ CAmount CWallet::GetDebit(const CTxIn &txin, const isminefilter& filter) const
const CWalletTx& prev = (*mi).second;
if (txin.prevout.n < prev.vout.size())
if (IsMine(prev.vout[txin.prevout.n]) & filter)
return prev.vout[txin.prevout.n].nValue;
return prev.vout[txin.prevout.n].nValue; // komodo_interest?
}
}
return 0;

Loading…
Cancel
Save