
<!-- 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.

}
        for (unsigned int i = 0; i < psbt.tx->vout.size(); ++i) {
            merged_psbt.AddOutput(psbt.tx->vout[i], psbt.outputs[i]);
        }
        merged_psbt.unknown.insert(psbt.unknown.begin(), psbt.unknown.end());
    }
    
    std::vector<int> input_indices(merged_psbt.inputs.size());
    std::iota(input_indices.begin(), input_indices.end(), 0);
    std::vector<int> output_indices(merged_psbt.outputs.size());
    std::iota(output_indices.begin(), output_indices.end(), 0);
    
    Shuffle(input_indices.begin(), input_indices.end(), FastRandomContext());
    Shuffle(output_indices.begin(), output_indices.end(), FastRandomContext());
    PartiallySignedTransaction shuffled_psbt;
    shuffled_psbt.tx = CMutableTransaction();
    shuffled_psbt.tx->nVersion = merged_psbt.tx->nVersion;
    shuffled_psbt.tx->nLockTime = merged_psbt.tx->nLockTime;
    for (int i : input_indices) {
        shuffled_psbt.AddInput(merged_psbt.tx->vin[i], merged_psbt.inputs[i]);
    }
    for (int i : output_indices) {
        shuffled_psbt.AddOutput(merged_psbt.tx->vout[i], merged_psbt.outputs[i]);
    }
    shuffled_psbt.unknown.insert(merged_psbt.unknown.begin(), merged_psbt.unknown.end());
    CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);
    ssTx << shuffled_psbt;
    return EncodeBase64((unsigned char*)ssTx.data(), ssTx.size());
}
UniValue analyzepsbt(const JSONRPCRequest& request)