Bitcoin Forum
June 15, 2024, 04:40:28 AM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Are CBlock and CBlockHeader compatible with older versions of BTC?  (Read 664 times)
cloudboy (OP)
Hero Member
*****
Offline Offline

Activity: 690
Merit: 501


View Profile
March 12, 2015, 03:13:36 AM
 #1

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).
bitcreditscc
Hero Member
*****
Offline Offline

Activity: 602
Merit: 501



View Profile
March 12, 2015, 09:27:40 AM
 #2

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

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!