void ser_peer(cstring *s, unsigned int protover, const struct peer *peer) { ser_bp_addr(s, protover, &peer->addr); ser_s64(s, peer->last_ok); ser_u32(s, peer->n_ok); ser_s64(s, peer->last_fail); ser_u32(s, peer->n_fail); }
cstring *ser_msg_version(const struct msg_version *mv) { cstring *s = cstr_new_sz(256); ser_u32(s, mv->nVersion); ser_u64(s, mv->nServices); ser_s64(s, mv->nTime); ser_bp_addr(s, MIN_PROTO_VERSION, &mv->addrTo); ser_bp_addr(s, MIN_PROTO_VERSION, &mv->addrFrom); ser_u64(s, mv->nonce); ser_str(s, mv->strSubVer, sizeof(mv->strSubVer)); ser_u32(s, mv->nStartingHeight); return s; }
void btc_tx_out_serialize(cstring* s, const btc_tx_out* tx_out) { ser_s64(s, tx_out->value); ser_varstr(s, tx_out->script_pubkey); }