コード例 #1
0
ファイル: CBNetworkAddress.c プロジェクト: GMD1987/cbitcoin
CBNetworkAddress * CBNewNetworkAddress(uint64_t lastSeen, CBByteArray * ip, uint16_t port, CBVersionServices services, bool isPublic){
	CBNetworkAddress * self = malloc(sizeof(*self));
	if (NOT self) {
		CBLogError("Cannot allocate %i bytes of memory in CBNewNetworkAddress\n", sizeof(*self));
		return NULL;
	}
	CBGetObject(self)->free = CBFreeNetworkAddress;
	if (CBInitNetworkAddress(self, lastSeen, ip, port, services, isPublic))
		return self;
	free(self);
	return NULL;
}
コード例 #2
0
ファイル: CBNetworkAddress.c プロジェクト: Jud/cbitcoin
CBNetworkAddress * CBNewNetworkAddress(uint64_t lastSeen, CBByteArray * ip, uint16_t port, CBVersionServices services, bool isPublic){
	CBNetworkAddress * self = malloc(sizeof(*self));
	CBGetObject(self)->free = CBFreeNetworkAddress;
	CBInitNetworkAddress(self, lastSeen, ip, port, services, isPublic);
	return self;
}