
<!-- Describe the issue -->
Following commit 46004790588c24174a0bec49b540d158ce163ffd (@achow101), `decodepsbt` overstates the fee, apparently including both the `witness_utxo` and `non_witness_utxo` amounts in the inputs.

**Expected behavior**

The decoded fee should be the sum of the inputs, minus the sum of the outputs.

**Actual behavior**

The decoded fee is exactly twice the amount of the inputs, minus the sum of the outputs.

**To reproduce**

Build any PSBT using `createpsbt`, `walletprocesspsbt`, then decode it with `decodepsbt`. See the `fee` field in the JSON.

**System information**

I compiled myself from 5550fa5983ea59e7ccef6540b7ec49a1770fb3ca on Whonix 14.

Then I did `git revert 46004790588c24174a0bec49b540d158ce163ffd ` and the problem went away.

#include <util/string.h>
#include <validation.h>
#include <validationinterface.h>
#include <numeric>
#include <stdint.h>
#include <univalue.h>
static void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry)
{
    
    
    
    
    
    TxToUniv(tx, uint256(), entry, true, RPCSerializationFlags());
    if (!hashBlock.IsNull()) {
        LOCK(cs_main);
        entry.pushKV("blockhash", hashBlock.GetHex());
        CBlockIndex* pindex = LookupBlockIndex(hashBlock);
        if (pindex) {
            if (::ChainActive().Contains(pindex)) {
                entry.pushKV("confirmations", 1 + ::ChainActive().Height() - pindex->nHeight);
                entry.pushKV("time", pindex->GetBlockTime());
                entry.pushKV("blocktime", pindex->GetBlockTime());
            }
            else
                entry.pushKV("confirmations", 0);
        }
    }
}
static UniValue getrawtransaction(const JSONRPCRequest& request)