Author

Topic: CBlockHeader new element (Read 647 times)

full member
Activity: 238
Merit: 100
November 13, 2013, 04:11:30 AM
#2
No idea. Could it be an alignment problem?

I'm not into the code yet but those who are probably need more info and error messages
full member
Activity: 206
Merit: 102
step forward
November 12, 2013, 10:03:37 AM
#1
Bitcoin-qt client clone,
Anyone knows, Why Block  +  SERIALIZE does not work for me adding  new member type char (+1byte)?
But, it works if the new type is uint64_t (+8 bytes)

Code:
// core.h , main.h
 // header
    static const int CURRENT_VERSION=2;
    int nVersion;
    uint256 hashPrevBlock;
    uint256 hashMerkleRoot;
    unsigned int nTime;
    unsigned int nBits;
    unsigned int nNonce;
    uint64_t newMember; //     char newMember;
...

Code:
//txdb.cpp
                CBlockIndex* pindexNew = InsertBlockIndex(diskindex.GetBlockHash());
                pindexNew->pprev          = InsertBlockIndex(diskindex.hashPrev);
                pindexNew->nHeight        = diskindex.nHeight;
                pindexNew->nFile          = diskindex.nFile;
                pindexNew->nDataPos       = diskindex.nDataPos;
                pindexNew->nUndoPos       = diskindex.nUndoPos;
                pindexNew->nVersion       = diskindex.nVersion;
                pindexNew->hashMerkleRoot = diskindex.hashMerkleRoot;
                pindexNew->nTime          = diskindex.nTime;
                pindexNew->nBits          = diskindex.nBits;
                pindexNew->nNonce         = diskindex.nNonce;
                pindexNew->newMember    = diskindex.newMember; //      newMember
                pindexNew->nStatus        = diskindex.nStatus;
                pindexNew->nTx            = diskindex.nTx;
Jump to: