Closed poiuty closed 9 years ago
So, we have 7 case. https://github.com/darkcoin/darkcoin/blob/master/src/main.cpp
bool static AlreadyHave(const CInv& inv)
{
switch (inv.type)
{
case MSG_TX:
{
bool txInMap = false;
txInMap = mempool.exists(inv.hash);
return txInMap || mapOrphanTransactions.count(inv.hash) ||
pcoinsTip->HaveCoins(inv.hash);
}
case MSG_BLOCK:
return mapBlockIndex.count(inv.hash) ||
mapOrphanBlocks.count(inv.hash);
case MSG_TXLOCK_REQUEST:
return mapTxLockReq.count(inv.hash) ||
mapTxLockReqRejected.count(inv.hash);
case MSG_TXLOCK_VOTE:
return mapTxLockVote.count(inv.hash);
case MSG_SPORK:
return mapSporks.count(inv.hash);
case MSG_MASTERNODE_WINNER:
return mapSeenMasternodeVotes.count(inv.hash);
case MSG_MASTERNODE_SCANNING_ERROR:
return mapMasternodeScanningErrors.count(inv.hash);
}
// Don't know what it is, just say we already got one
return true;
}
Try add it => and we get same error.
('type', pack.EnumType(pack.IntType(32), {1: 'tx', 2: 'block', 3: 'txlock_request', 4: 'txlock_vote', 5: 'spork', 6: 'masternode_winner', 7: 'masternode_scanning_error')),
But => exceptions.ValueError: enum data (8) => so what is 8 type? Try add
('type', pack.EnumType(pack.IntType(32), {1: 'tx', 2: 'block', 3: 'txlock_request', 4: 'txlock_vote', 5: 'spork', 6: 'masternode_winner', 7: 'masternode_scanning_error', 8: 'test')),
And get
Unknown inv type {'type': 'test', 'hash': 85018028629704193983546970934772094848258373244713604991801059976327843196613L}`
What is the correct name for the type 8?
possible fix in /p2pool/bitcoin/p2p.py
message_inv = pack.ComposedType([
('invs', pack.ListType(pack.ComposedType([
('type', pack.EnumType(pack.IntType(32), {1: 'tx', 2: 'block', 3: 'txlock_request', 4: 'txlock_vote', 5: 'spork', 6: 'masternode_winner', 7: 'masternode_scanning_error', 8: 'unknown'})),
('hash', pack.IntType(256)),
]))),
])
def handle_inv(self, invs):
for inv in invs:
if inv['type'] == 'tx':
self.send_getdata(requests=[inv])
elif inv['type'] == 'block':
self.factory.new_block.happened(inv['hash'])
# else:
# print 'Unknown inv type', inv
I believe this is also fixed in pull request #10
Yes.
Old bug (not crit) => https://dashtalk.org/threads/nekorrektnye-bloki.3949/
Looks like these errors are caused by our recent shifting to inv messages https://github.com/darkcoin/darkcoin/blob/a119b3008caafc49d1885b280283769570284f52/src/main.cpp#L3882-L3890
This place looks like a good start to fix it https://github.com/UdjinM6/p2pool-drk/blob/master/p2pool/darkcoin/p2p.py#L66-L71