Skip to content

Commit

Permalink
Merge pull request #43 from volbil/rabbit
Browse files Browse the repository at this point in the history
Fix listunspent amounts
  • Loading branch information
volbil authored May 17, 2021
2 parents 97985c0 + ea0172e commit 541d0c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3180,6 +3180,8 @@ UniValue listunspent(const JSONRPCRequest& request)

RPCTypeCheck(request.params, boost::assign::list_of(UniValue::VNUM)(UniValue::VNUM)(UniValue::VARR)(UniValue::VNUM));

const int nHeight = chainActive.Height();

int nMinDepth = 1;
if (request.params.size() > 0)
nMinDepth = request.params[0].get_int();
Expand Down Expand Up @@ -3238,7 +3240,7 @@ UniValue listunspent(const JSONRPCRequest& request)
continue;
}

CAmount nValue = out.tx->vout[out.i].nValue;
CAmount nValue = out.tx->vout[out.i].GetValue(nHeight - out.nDepth, nHeight);
const CScript& pk = out.tx->vout[out.i].scriptPubKey;
UniValue entry(UniValue::VOBJ);
entry.push_back(Pair("txid", out.tx->GetHash().GetHex()));
Expand Down

0 comments on commit 541d0c9

Please sign in to comment.