Author

Topic: How to place tx in own mempool without broadcasting? (Read 214 times)

staff
Activity: 3458
Merit: 6793
Just writing some code
Oh gee that's a good idea.  And that just applies to the RPC call, right?  So it wouldn't interfere with broadcasting the transaction if/when the block is mined..??
Yes, it should only applies to the RPC call. Of course you should test that for yourself before actually using it.

Assuming that's the case, that's exactly what I'm looking for, thanks!  One quick question, is that code you highlighted also responsible for using sendrawtransaction via the bitcoin-cli program, or do I need to find and commend out code somewhere else for doing it via the cli?  Either way, it's no trouble to use the RPC interface, so you've definitely given me a working solution.  Thanks!
You can use bitcoin-cli. bitcoin-cli is just a tool to interact with the RPC interface.
hero member
Activity: 793
Merit: 1026
Oh gee that's a good idea.  And that just applies to the RPC call, right?  So it wouldn't interfere with broadcasting the transaction if/when the block is mined..??

Assuming that's the case, that's exactly what I'm looking for, thanks!  One quick question, is that code you highlighted also responsible for using sendrawtransaction via the bitcoin-cli program, or do I need to find and commend out code somewhere else for doing it via the cli?  Either way, it's no trouble to use the RPC interface, so you've definitely given me a working solution.  Thanks!
staff
Activity: 3458
Merit: 6793
Just writing some code
You can modify Bitcoin Core from source to disable transaction relay for things that come from the sendrawtransaction RPC command. Just remove or comment out these lines: https://github.com/bitcoin/bitcoin/blob/master/src/rpc/rawtransaction.cpp#L1018-L1022
hero member
Activity: 793
Merit: 1026
Is there a way I can add a transaction to my own memory pool without broadcasting it to the network?  Imagine I am mining my own transactions and want them kept secret from the network unless they are in a block.  (For example, a time-locked commitment that triggers another event which I want to make sure can only happen AFTER my tx is in a block.)

As far as I can figure, the only way to do this is to mine the transaction myself.  And right now, the only way I can think to do that is to run two nodes where one is a bridge "blocks only" node and is the sole node that the other (mining) node connects to.  Then I can add transactions to the mining node manually.  But then it won't know about any other transactions on the network that I might want to also include in the block I am mining.

Is there a way to accomplish this?  To have my transaction in my block template without broadcasting it?
Jump to: