You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When connecting to my node using P2P, I've noticed an additional '00' byte after the mnauth_challenge in the version message. I'm unsure if this byte should be considered padding and if it can be safely ignored. The parsing code appears to handle this situation, but I'd like clarification on whether this behavior is expected or if there's a recommended course of action.
I am using @dashpay/dashcore-p2p to connect to my node.
Parsing Code:
function(payload){varparser=newBufferReader(payload);this.version=parser.readUInt32LE();this.services=parser.readUInt64LEBN();this.timestamp=newDate(parser.readUInt64LEBN().toNumber()*1000);this.addrMe={services: parser.readUInt64LEBN(),ip: utils.parseIP(parser),port: parser.readUInt16BE()};this.addrYou={services: parser.readUInt64LEBN(),ip: utils.parseIP(parser),port: parser.readUInt16BE()};this.nonce=parser.read(8);this.subversion=parser.readVarLengthBuffer().toString();this.startHeight=parser.readUInt32LE();if(parser.finished()){this.relay=true;}else{this.relay=!!parser.readUInt8();}if(parser.finished()){this.mnAuthChallenge=null;}elseif(this.version>=70214){this.mnAuthChallenge=parser.read(32).toString('hex');}if(parser.buf.length-parser.pos===1){constpadding=parser.read(1).toString('hex')if(padding!=='00'){console.warn('Padding in version message is not 00')}}utils.checkFinished(parser);}
Received Version Message: 54120100050c0000000000001fce5465000000000000000000000000000000000000000000000000000000000000050c00000000000000000000000000000000000000000000000059598cfa03090524122f4461736820436f72653a31392e332e302f3c161e0001038fa544e1069133d3e1b65c5b41197ad43fb3ec508ca6ca111a88bc2425d06c00
Additionally, the provided parsing code includes a check for a single '00' byte at the end of the buffer. Is this expected behavior, and should it be handled in a specific way?
Any guidance or insights would be appreciated. Thank you!
The text was updated successfully, but these errors were encountered:
When connecting to my node using P2P, I've noticed an additional '00' byte after the mnauth_challenge in the version message. I'm unsure if this byte should be considered padding and if it can be safely ignored. The parsing code appears to handle this situation, but I'd like clarification on whether this behavior is expected or if there's a recommended course of action.
I am using @dashpay/dashcore-p2p to connect to my node.
Parsing Code:
Received Version Message:
54120100050c0000000000001fce5465000000000000000000000000000000000000000000000000000000000000050c00000000000000000000000000000000000000000000000059598cfa03090524122f4461736820436f72653a31392e332e302f3c161e0001038fa544e1069133d3e1b65c5b41197ad43fb3ec508ca6ca111a88bc2425d06c00
Additionally, the provided parsing code includes a check for a single '00' byte at the end of the buffer. Is this expected behavior, and should it be handled in a specific way?
Any guidance or insights would be appreciated. Thank you!
The text was updated successfully, but these errors were encountered: