RESOLVED // Error -4 Transfer

since some months, I make transaction on my local webapp, from zcashd to exernal zcash wallet.

No problem but since some days, I got error -4 “SendTransaction : CommitTransaction failed” on my zcash-cli when I analyse my operation id, I don’t know, why

If you can help me, impossible to transfer this coins…
If someone know why this error ?

This error looks only on these address, I make transaction with new address and no problem.

Thnaks you

There should be more info about the error in the debug.log

Exact, I see more details

But why I get this errors, network ? …

Thanks for your help

May 30 08:25:11.202  INFO main: CommitTransaction:
CTransaction(hash=d8f31152a3, ver=4, fOverwintered=1, nVersionGroupId=892f2085, vin.size=0, vout.size=0, nLockTime=0, nExpiryHeight=1266645, valueBalance=1000, vShieldedSpend.size=2, vShieldedOutput.size=1)
May 30 08:25:11.202  INFO main: AddToWallet d8f31152a35e546b196c2dcb4dab68a9b3001032962758709074d663d4359006  new
May 30 08:25:11.241 ERROR main: ContextualCheckTransaction(): transaction is expired. Resending when caught up with the blockchain, or manually setting the zcashd txexpirydelta parameter may help.
May 30 08:25:11.241 ERROR main: AcceptToMemoryPool: ContextualCheckTransaction failed
May 30 08:25:11.241  INFO main: CommitTransaction(): Error: Transaction not valid
May 30 08:25:11.242  INFO main: opid-21a2c212-c870-4210-8634-274e8e883aa1: z_sendmany finished (status=failed, error=SendTransaction: CommitTransaction failed)
May 30 08:25:30.071  INFO ProcessNewBlock: main: UpdateTip: new best hash=00000000000013ff4aabbf6250604f4b7f0aee8c5d2029a629f345a9ed2b961c height=1267220 bits=469913513 log2_work=58.628653 tx=8596762 date=2021-05-30 06:25:02 progress=1.000000 cache=88.0MiB(12282tx)

Is your node fully synced up? And how are you building the transaction?

Yes, my node is fully synced.
I build with curl and rpc call,

This method (on function)work on my app with no problem,
but when curl call are manually made, there is this error! This block amount.

$ch = curl_init();
	    curl_setopt_array($ch, [
	        CURLOPT_HTTPHEADER=>['Content-Type: text/plain;'],
	        CURLOPT_POSTFIELDS=>"{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"z_sendmany\", \"params\": [\"".$value['address']."\", [{\"address\": \"".$fromaddress."\", \"amount\": ".number_format($value['amount']-$config__feeToRemoveZcash,8)."}]] }",

	        $r4 = json_decode(curl_exec($ch),true);

Sometimes work, and sometimes not work, the problem seems arbitrary

Transactions expire after 20 blocks (based on the latest downloaded block). It seems that when the transaction was made, it was already set to expire. nExpiryHeight=1266645 but tip is height=1267220.

It looks like this issue: Client sends an expired transaction when not caught up with blockchain · Issue #3393 · zcash/zcash · GitHub
But you say you are fully caught up…

1 Like

But you say you are fully caught up…

I don’t understand this ?
Thanks for your answers but I didn’t find any correct answers on your link…

From your debug file log it looks like from the time that you created the transaction, to the time you sent it 20 blocks had passed. So the transaction expired and could not be sent.

In Zcash blocks are every 75 seconds, so that means if you wait more than 25 mins to send a Transaction 20 blocks will have passed.


Finally, I resolved problem with this link : bad-txns-joinsplit-requirements-not-met · Issue #3114 · zcash/zcash · GitHub and it’s workssssssss

Thanks everyone

./zcashd -rescan save me.

I have more information,

make transaction(s) with ./zcashd will failed but ./zcashd -printtoconsole will sucess