Skip to content

Instantly share code, notes, and snippets.

@lontivero
Last active December 11, 2018 20:34
Show Gist options
  • Save lontivero/f1884d4df2fbf1ad06d8cf17cae0bd5d to your computer and use it in GitHub Desktop.
Save lontivero/f1884d4df2fbf1ad06d8cf17cae0bd5d to your computer and use it in GitHub Desktop.
testmempoolaccept RPC method call
bbcli="bitcoin-cli -regtest -datadir=/home/lontivero/tmp/bitcoind"
miner_address=$($bbcli getnewaddress)
address=$($bbcli getnewaddress)
generated_blocks=$($bbcli generatetoaddress 101 $miner_address)
txid=$($bbcli listunspent | jq '.[].txid')
unsigned_raw_tx=$($bbcli createrawtransaction "[{\"txid\":\"$txid\", \"vout\":0}]" "[{\"$address\":30}]")
$bbcli testmempoolaccept "[\"$unsigned_raw_tx\"]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment