diff --git a/common/bit_array.go b/common/bit_array.go index d478d02ec..320b629ef 100644 --- a/common/bit_array.go +++ b/common/bit_array.go @@ -156,6 +156,7 @@ func (bA *BitArray) Sub(o *BitArray) *BitArray { i := len(o.Elems) - 1 if i >= 0 { for idx := i * 64; idx < o.Bits; idx++ { + // NOTE: each individual GetIndex() call to o is safe. c.setIndex(idx, c.getIndex(idx) && !o.GetIndex(idx)) } } diff --git a/p2p/connection.go b/p2p/connection.go index 9984d835e..aa4b4394c 100644 --- a/p2p/connection.go +++ b/p2p/connection.go @@ -419,7 +419,7 @@ FOR_LOOP: } msgBytes := channel.recvMsgPacket(pkt) if msgBytes != nil { - //log.Debug("Received bytes", "chId", pkt.ChannelId, "msgBytes", msgBytes) + log.Debug("Received bytes", "chId", pkt.ChannelId, "msgBytes", msgBytes) c.onReceive(pkt.ChannelId, msgBytes) } default: @@ -605,7 +605,7 @@ type msgPacket struct { } func (p msgPacket) String() string { - return fmt.Sprintf("MsgPacket{%X:%X}", p.ChannelId, p.Bytes) + return fmt.Sprintf("MsgPacket{%X:%X T:%X}", p.ChannelId, p.Bytes, p.EOF) } //-----------------------------------------------------------------------------