Exemplo n.º 1
0
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);
}
Exemplo n.º 2
0
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;
}
Exemplo n.º 3
0
Arquivo: tx.c Projeto: afk11/libbtc
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);
}