0

I'm developing a bitcoin application which saves Block to a file from which it can be read at later point of time. So I'm converting CDataStream vRecv to hex string using below bitcoin defined function call.

hxs = HexStr(vRecv.str())

At later point App reads this string, It first initializes CDataStream object as

CDataStream vRead(ParseHex(hxs),SER_NETWORK,PROTOCOL_VERSION)

I'd retreive block using vRead>>block; operation.

But above steps is throwing below error

************************
EXCEPTION: NSt8ios_base7failureB5cxx11E       
CDataStream::read(): end of data: iostream error       
bitcoin in msghand       



************************
EXCEPTION: NSt8ios_base7failureB5cxx11E       
CDataStream::read(): end of data: iostream error       
bitcoin in msghand       

terminate called after throwing an instance of 'std::ios_base::failure[abi:cxx11]'
  what():  CDataStream::read(): end of data: iostream error
Aborted (core dumped)

After going through code, I'm suspecting HexStr and ParseHex aren't complements of each other to encode and decode string.

I'd be glad to know what is wrong with my logic.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.