<p>You can use Bitcoin Core's <code>testmempoolaccept</code> RPC. It will tell you whether the transaction you give it would be accepted into your node's mempool at that time but won't actually add it to the mempool or broadcast it.</p>

CC BY-SA 4.0
2019-04-07T08:31:00.510Z
But then the question is how to convert a transaction to a full raw hex transaction ?
user2284570
CC BY-SA 4.0
2019-04-07T16:53:08.413Z
@user2284570 In what format do you have the transaction, if not raw hex?
Pieter Wuille
CC BY-SA 4.0
2019-04-08T10:04:18.680Z
@PieterWuille I have it in partial hex. I mean I have only the output in hex which means I would have expected something which would take the TxOut hex and the private key for automatically selecting utxo and perform signing.
user2284570
CC BY-SA 4.0
2019-04-08T16:52:37.590Z
You can create a transaction with no inputs using `createrawtransaction`, add inputs to it using `fundrawtransaction`, and then sign it with `signrawtransactionwithwallet` or `signrawtransactionwithkey`.
Ava Chow
CC BY-SA 4.0
2019-04-06T23:09:56.280Z
2019-04-06T23:09:56.280Z
Ava Chow
<p>The problem with Testnet is all types of transactions are allowed, so how can I know if a transaction would be rejected on mainet ?</p>

<testnet><non-standard-transaction>
How to test if a transaction is standard without spending real money?
user2284570
# How to test if a transaction is standard without spending real money?

(Asked by: username_0 on 2019-04-06)

The problem with Testnet is all types of transactions are allowed, so how can I know if a transaction would be rejected on mainet ?

**Tags:** testnet, non-standard-transaction


---

## 1 answers

### Answer by username_1 on 2019-04-06. Score: 7

You can use Bitcoin Core's `testmempoolaccept` RPC. It will tell you whether the transaction you give it would be accepted into your node's mempool at that time but won't actually add it to the mempool or broadcast it.

> **Comments:**
> **username_0**: But then the question is how to convert a transaction to a full raw hex transaction ?  
> **username_2**: @username_0 In what format do you have the transaction, if not raw hex?  
> **username_0**: @username_2 I have it in partial hex. I mean I have only the output in hex which means I would have expected something which would take the TxOut hex and the private key for automatically selecting utxo and perform signing.  
> **username_1**: You can create a transaction with no inputs using `createrawtransaction`, add inputs to it using `fundrawtransaction`, and then sign it with `signrawtransactionwithwallet` or `signrawtransactionwithkey`.  

---

