Fix messages example
This commit is contained in:
parent
ecf2931aad
commit
1082fc708a
|
@ -119,9 +119,8 @@ var addrPayload = messages.addr.encodePayload([
|
|||
var addrmsg = structs.message.encode("addr", addrPayload);
|
||||
var decoded = structs.message.decode(addrmsg);
|
||||
console.log(decoded.command); // addr
|
||||
var payload = decoded.payload;
|
||||
var decodedPayload = messages.addr.decodePayload(payload);
|
||||
console.log(decodedPayload.addrs[0].host); // 2.2.2.2
|
||||
var addr = messages.addr.decodePayload(decoded.payload);
|
||||
console.log(addr.addrs[0].host); // 2.2.2.2
|
||||
|
||||
// Encode with empty payload:
|
||||
var verackmsg = structs.message.encode("verack");
|
||||
|
|
|
@ -22,9 +22,8 @@
|
|||
* var addrmsg = structs.message.encode("addr", addrPayload);
|
||||
* var decoded = structs.message.decode(addrmsg);
|
||||
* console.log(decoded.command); // addr
|
||||
* var payload = decoded.payload;
|
||||
* var decodedPayload = messages.addr.decodePayload(payload);
|
||||
* console.log(decodedPayload.addrs[0].host); // 2.2.2.2
|
||||
* var addr = messages.addr.decodePayload(decoded.payload);
|
||||
* console.log(addr.addrs[0].host); // 2.2.2.2
|
||||
*
|
||||
* // Encode with empty payload:
|
||||
* var verackmsg = structs.message.encode("verack");
|
||||
|
|
Loading…
Reference in New Issue
Block a user