sipa / bitcoin

Bitcoin integration/staging tree
http://www.bitcoin.org
MIT License
88 stars 21 forks source link

Fixed CInv::IsKnownType() #23

Closed CodeShark closed 8 years ago

NicolasDorier commented 8 years ago

You should get rid of

bool operator<(const CInv& a, const CInv& b)

Either it is used somewhere, and just got broken by type's wit flag. Either it is not, and it takes space for nothing.

CodeShark commented 8 years ago

Yes, PR #24 is the branch where we should do that.

sipa commented 8 years ago

Merged into segwit2. There is a warning to fix though:

21:04:54 < sipa> main.cpp:5063:103: warning: enumeral mismatch in conditional expression: ‘GetDataMsgWithFlags’ vs ‘GetDataMsg’ [-Wenum-compare]
21:04:54 < sipa>                      vGetData.push_back(CInv(State(pfrom->GetId())->fHaveWitness ? MSG_WITNESS_BLOCK : MSG_BLOCK, pindex->GetBlockHash()));
21:04:54 < sipa>                                                                                                        ^
sipa commented 8 years ago

@CodeShark Fix for the enum issue still welcome.

CodeShark commented 8 years ago

@sipa #29