CBTransactionInput * CBNewTransactionInput(CBScript * script,uint32_t sequence, CBByteArray * prevOutHash,uint32_t prevOutIndex,void (*onErrorReceived)(CBError error,char *,...)){ CBTransactionInput * self = malloc(sizeof(*self)); if (NOT self) { onErrorReceived(CB_ERROR_OUT_OF_MEMORY,"Cannot allocate %i bytes of memory in CBNewTransactionInput\n",sizeof(*self)); return NULL; } CBGetObject(self)->free = CBFreeTransactionInput; if(CBInitTransactionInput(self,script,sequence,prevOutHash,prevOutIndex,onErrorReceived)) return self; free(self); return NULL; }
CBTransactionInput * CBNewTransactionInput(CBScript * script, uint32_t sequence, CBByteArray * prevOutHash, uint32_t prevOutIndex){ CBTransactionInput * self = malloc(sizeof(*self)); CBGetObject(self)->free = CBFreeTransactionInput; CBInitTransactionInput(self, script, sequence, prevOutHash, prevOutIndex); return self; }