[Peerunity - Raw transactions RPC #20 pull req] sending invalid tx

Created raw tx with tx.time field (Peercoin specific) set to zero, my ppcoind tried to broadcast it and got ~banned by network. Now, 12 hours later, I still cannot connect to any active node - so cannot sync/send/receive.
While for me it isn’t big problem but if I’d ran service I’d be pissed.
I have to check the code but don’t you think there should be an option to enable ‘relay rules’ on sendrawtransaction?

Just realized that it isn’t related to reference client

Were you banned after sending only one invalid transaction, or did you send many transactions the network didn’t accept (which triggered the 24h ban of your IP address for DoS protection) ?

I looked at the code (CTxMemPool::accept and CTransaction::CheckTransaction functions in main.cpp) of the tests that are done before accepting a transaction in the memory pool, and there doesn’t seem to be anything saying that a tx.time of 0 is intrinsically invalid…

I did send few txs that later occurred to be invalid, got hundreds of

ERROR: ConnectInputs() : transaction timestamp earlier than input transaction

in debug.log, example connection attempt

connected 74.207.249.18:9903 ERROR: ConnectInputs() : transaction timestamp earlier than input transaction ERROR: ConnectInputs() : transaction timestamp earlier than input transaction ERROR: ConnectInputs() : transaction timestamp earlier than input transaction ERROR: ConnectInputs() : transaction timestamp earlier than input transaction ERROR: ConnectInputs() : transaction timestamp earlier than input transaction ERROR: ConnectInputs() : transaction timestamp earlier than input transaction ERROR: ConnectInputs() : transaction timestamp earlier than input transaction ERROR: ConnectInputs() : transaction timestamp earlier than input transaction socket closed disconnecting node 74.207.249.18:9903
I’ve re-created wallet and I’ll check scenario with single invalid tx after regain access to the network.

Thread originally had title “safe mode for sendrawtransaction” - optionally enable tx validation

I added an optional parameter to the ‘sendrawtransaction’ RPC to indicate wether to check the inputs of the transaction before sending it (https://github.com/glv2/peercoin/commit/5c49cafa923e1b226d1051cb2abef6d3998332aa).

sendrawtransaction <hex string> [checkinputs=0]

However, only the standard transactions will pass the test, so if you want to send a transaction with a non-standard “pay to script hash” input (e.g. multisig address), ‘checkinputs’ must be 0.

Thanks, I’ll check it in a moment .
Ban is painful, I currently have 2 connections, from which one is my VPS.

It works

TX rejected

ThreadRPCServer method=sendrawtransaction ERROR: ConnectInputs() : transaction timestamp earlier than input transaction ERROR: CTxMemPool::accept() : ConnectInputs failed 4eae3f6c7a 2014-05-11 07:04:41 UTC Flushing wallet.dat Flushed wallet.dat 19ms