Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: cloudboy on March 12, 2015, 03:13:36 AM



Title: Are CBlock and CBlockHeader compatible with older versions of BTC?
Post by: cloudboy on March 12, 2015, 03:13:36 AM
Hi,

I am trying to rebase some old btc code the current. It is before CBlock and CBlockHeader were split into two separate classes.

When it syncs and receives a 'block' message from a peer, it gets an error:

Code:
if (strCommand == "block"){
    CBlock block;
    vRecv >> block;
...

Shifting vRecv into block gives me an error.
Code:
ReadCompactSize(): size too large
.

However, if I make 'block' a CBlockHeader, it all works. (Except it doesn't have the tx list and everything else I need).


Title: Re: Are CBlock and CBlockHeader compatible with older versions of BTC?
Post by: bitcreditscc on March 12, 2015, 09:27:40 AM
I work extensively with the new BTC codebase, if you intend to rebase, your best option is to just copy the params of your old chain, then use a copy of the old chain to bootstrap.

An actual manual rebase is a hell of a lot of work and completely unnecessary unless you made some very significant changes.

Note that the changes to CBlock are just the beggining, there's mempool, script and CCoinsview to worry about and considering that these changes were made over a long time by a large dev group double checking each other's work, it's higly unlikely you can pull off a proper and functional rebase alone.

I tried bringing PoS to 2015 standards and gave it up as a bad job