What does this response mean. I’ve been building the transaction myself using bitwasp/bitcoin-php, after trawling the examples for a while and trying to get something together it seems that everything is correct but when I send the data to the blockcypher endpoint I get this error in return.
Error validating transaction: Transaction b215c5e8184124d*****672fa22b8925eb3c******* orphaned, missing reference 2d2d2d********42204e49474542. ◀
The code I’m using to generate the transaction’s is as follows:
$addrCreator = new AddressCreator(); $tx = TransactionFactory::build() ->input($txhash, 0) ->payToAddress(($databaseContainer->btcprice / 0.00000001), $addrCreator->fromString('MyWalletAddressAsString')) ->get(); $privKeyFactory = new PrivateKeyFactory(); $key = $privKeyFactory->fromHexCompressed($databaseContainer->private_key); $ec = Bitcoin::getEcAdapter(); $signer = new MessageSigner($ec); $tx = $tx->getHex(); $signed = $signer->sign($tx, $key); $signed = $signed->getBuffer()->getHex(); $url = "https://api.blockcypher.com/v1/btc/main/txs/push?token=mytoken"; $data = array( "tx" => $signed ); $json_encoded_data = json_encode($data); $ch = curl_init($url); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $json_encoded_data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($json_encoded_data)) ); $transaction_response = json_decode(curl_exec($ch)); curl_close($ch);
It’s probably something simple, but does anyone have any idea what is going wrong?