Bitcoin Core 0.15 and addrindex

Just spent some time trying to apply the patch from 0.14 to 0.15, no luck (because no competence).

But here are some things that I forgot and remembered today as I was digging through repos and issues:

Bitcoin Core and addrindex related stuff:

If anybody wants to try:

[1]

nBlockTreeDBCache = std::min(nBlockTreeDBCache, ((GetBoolArg("-txindex", DEFAULT_TXINDEX) && GetBoolArg("-addrindex", DEFAULT_ADDRINDEX)) ? nMaxBlockDBAndTxIndexCache : nMaxBlockDBCache) << 20);
nTotalCache -= nBlockTreeDBCache;
int64_t nCoinDBCache = std::min(nTotalCache / 2, (nTotalCache / 4) + (1 << 23)); // use 25%-50% of the remainder for disk cache
nCoinDBCache = std::min(nCoinDBCache, nMaxCoinsDBCache << 20); // cap total coins db cache
nTotalCache -= nCoinDBCache;
nCoinCacheUsage = nTotalCache; // the rest goes to in-memory cache

[2]


    UniValue result(UniValue::VARR);
    while (it != setpos.end() && nCount--) {
        //std::string CTransactionRef tx;
        CTransactionRef tx;
        uint256 hashBlock;
        //if (!ReadTransaction(tx, *it, hashBlock))
        //    throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Cannot read transaction from disk");
        CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);
        ssTx << tx;
        std::string strHex = HexStr(ssTx.begin(), ssTx.end());
        // strHex = HexStr(ssTx.begin(), ssTx.end());
        if (fVerbose) {
            UniValue object(UniValue::VOBJ);
            TxToJSON(*tx, hashBlock, object);
            object.push_back(Pair("hex", strHex));
            result.push_back(object);
        } else {
            result.push_back(strHex);
        }
        it++;
    }

[3 ]

Edit: I am down just to this error (but who knows what other errors are to follow).

validation.cpp: In function ‘bool ConnectBlock(const CBlock&, CValidationState&, CBlockIndex*, CCoinsViewCache&, const CChainParams&, bool)’:
validation.cpp:1878:21: error: ‘CCoins’ was not declared in this scope
                     CCoins coins;
                     ^
validation.cpp:1879:26: error: ‘class CCoinsViewCache’ has no member named ‘GetCoins’
                     view.GetCoins(txin.prevout.hash, coins);
                          ^
validation.cpp:1879:54: error: ‘coins’ was not declared in this scope
                     view.GetCoins(txin.prevout.hash, coins);
                                                      ^
  CXX      libbitcoin_common_a-coins.o
In file included from ./script/script.h:11:0,
                 from primitives/transaction.h:11,
                 from coins.h:9,
                 from validation.h:14,
                 from validation.cpp:6:
./serialize.h: In instantiation of ‘void Unserialize(Stream&, T&) [with Stream = CAutoFile; T = CTransaction]’:
streams.h:553:22:   required from ‘CAutoFile& CAutoFile::operator>>(T&) [with T = CTransaction]’
validation.cpp:968:17:   required from here
./serialize.h:544:5: error: ‘class CTransaction’ has no member named ‘Unserialize’
     a.Unserialize(is);
     ^
1 Like

The answer to C++ issues:

1 Like