`CCoinsViewCache::GetValueIn(…)` performs money summation like this:

```c++
CAmount CCoinsViewCache::GetValueIn(const CTransaction& tx) const
{
    if (tx.IsCoinBase())
        return 0;

    CAmount nResult = 0;
    for (unsigned int i = 0; i < tx.vin.size(); i++)
        nResult += AccessCoin(tx.vin[i].prevout).out.nValue;

    return nResult;
}
```

Note that no check is done to make sure that the resulting `nResult` is such that it stays within the money bounds (`MoneyRange(nResult)`), or that the summation does not trigger a signed integer overflow.

Proof of concept output:

```
coins.cpp:243:17: runtime error: signed integer overflow: 9223200000000000000 + 2100000000000000 cannot be represented in type 'long'
GetValueIn = -9221444073709551616
```

Proof of concept code:

```c++
CMutableTransaction mutable_transaction;
mutable_transaction.vin.resize(4393);

Coin coin;
coin.out.nValue = MAX_MONEY;
assert(MoneyRange(coin.out.nValue));

CCoinsCacheEntry coins_cache_entry;
coins_cache_entry.coin = coin;
coins_cache_entry.flags = CCoinsCacheEntry::DIRTY;

CCoinsView backend_coins_view;
CCoinsViewCache coins_view_cache{&backend_coins_view};
CCoinsMap coins_map;
coins_map.emplace(COutPoint{}, std::move(coins_cache_entry));
coins_view_cache.BatchWrite(coins_map, {});

const CAmount total_value_in = coins_view_cache.GetValueIn(CTransaction{mutable_transaction});
std::cout << "GetValueIn = " << total_value_in << std::endl;
```

As far as I can tell `CCoinsViewCache::GetValueIn` is unused outside of tests:

```sh
$ git grep GetValueIn ":(exclude)src/test/" ":(exclude)src/bench/"
src/coins.cpp:CAmount CCoinsViewCache::GetValueIn(const CTransaction& tx) const
src/coins.h:    CAmount GetValueIn(const CTransaction& tx) const;
src/primitives/transaction.h:    // GetValueIn() is a method on CCoinsViewCache, because
```

I suggest we drop the unused `CCoinsViewCache::GetValueIn(…)`.

Any objections? :)
t.vin[0].scriptSig = CScript()
        << OP_TRUE << OP_0 << OP_1NEGATE << OP_16 
        << std::vector<unsigned char>(75, 0)      
        << std::vector<unsigned char>(235, 0)     
        << std::vector<unsigned char>(1234, 0)    
        << OP_9;
    BOOST_CHECK(IsStandardTx(CTransaction(t), reason));
    const std::vector<unsigned char> non_push_ops = { 
        OP_NOP, OP_VERIFY, OP_IF, OP_ROT, OP_3DUP, OP_SIZE, OP_EQUAL, OP_ADD, OP_SUB,
        OP_HASH256, OP_CODESEPARATOR, OP_CHECKSIG, OP_CHECKLOCKTIMEVERIFY };
    CScript::const_iterator pc = t.vin[0].scriptSig.begin();
    while (pc < t.vin[0].scriptSig.end()) {
        opcodetype opcode;
        CScript::const_iterator prev_pc = pc;
        t.vin[0].scriptSig.GetOp(pc, opcode); 
        
        if (opcode >= 1 && opcode <= OP_PUSHDATA4)
            continue;
        int index = prev_pc - t.vin[0].scriptSig.begin();
        unsigned char orig_op = *prev_pc; 
        
        for (auto op : non_push_ops) {
            t.vin[0].scriptSig[index] = op;
            BOOST_CHECK(!IsStandardTx(CTransaction(t), reason));
            BOOST_CHECK_EQUAL(reason, "scriptsig-not-pushonly");
        }
        t.vin[0].scriptSig[index] = orig_op; 
        BOOST_CHECK(IsStandardTx(CTransaction(t), reason));
    }