petertodd / replace-by-fee-tools

Tools to test out replace-by-fee
GNU General Public License v3.0
145 stars 45 forks source link

Getting a txn-mempool-conflict #7

Closed FrozenPrincess closed 7 years ago

FrozenPrincess commented 8 years ago

The first attempt I tried ended with 66: mempool min fee not met so I ran this:

./doublespend.py 1CfryEy3uwuKPbrQGETbDFQNuvJV1TBx7g 0.005 --fee1 0.0001

DEBUG:root:Delta fee: 0.0050078 DEBUG:root:Adding new input 607858d7dabd8d90754df5e2ff2798ae67745225a672c0ad36ba5d3dc11fa5f2:0 with value 0.01 BTC DEBUG:root:Delta fee: 0.0050226 DEBUG:root:Payment tx 0100000001f2a51fc13d5dba36adc072a625527467ae9827ffe2f54d75908dbddad7587860000000006a473044022062a8b5eb0300ff7f9d82dba17935bd643684d7853563bfc5b96a7ba211b088b6022021acd2899ab1b278d90b4b7b984d6138fa5875c1ed60eda60614ce9a69a56513012102dfc3a07f7f03052c0b9c971fa3e649142d77c383454c4a2977b0646044177872ffffffff024c980700000000001976a9146c477806c3b0b47c9d26f3f58e9f1476f4567e6f88ac20a10700000000001976a9148002e71a87a4dd056e615685fa63803766c3720588ac00000000 INFO:root:Payment tx size: 0.225 KB, fees: 0.0000226, 0.00010044 BTC/KB INFO:root:Sent payment tx: dad38fc66d2f23645559893c3583be8d47c17779cfb9634ba38e8e040c24db3f INFO:root:Sleeping for 15 seconds DEBUG:root:Delta fee: 0.000191 DEBUG:root:Double-spend tx 0100000001f2a51fc13d5dba36adc072a625527467ae9827ffe2f54d75908dbddad7587860000000006b4830450221009322432d8f79f555e719d58a20bc7f7f6bfe788a8ac58e89d6bbf95672fe889502202c3962cfc82de5c0e58c2bf0d945e583091359af9b210c35917606acb8456290012102dfc3a07f7f03052c0b9c971fa3e649142d77c383454c4a2977b0646044177872ffffffff01a4f70e00000000001976a9146c477806c3b0b47c9d26f3f58e9f1476f4567e6f88ac00000000 INFO:root:Double-spend tx size: 0.192 KB, fees: 0.000191, 0.00099479 BTC/KB Traceback (most recent call last): File "./doublespend.py", line 220, in txid = rpc.sendrawtransaction(tx) File "/root/replace-by-fee-tools/bitcoin/rpc.py", line 549, in sendrawtransaction r = self._call('sendrawtransaction', hextx) File "/root/replace-by-fee-tools/bitcoin/rpc.py", line 188, in _call raise JSONRPCError(response['error']) bitcoin.rpc.JSONRPCError: msg: '258: txn-mempool-conflict' code: -26

FrozenPrincess commented 8 years ago

Ah, the first transaction it created: dad38fc66d2f23645559893c3583be8d47c17779cfb9634ba38e8e040c24db3f

appears to not be bip125 replaceable, so that's why my node rejected it.

Is there a way to get it to generate and double spend bip125 replaceable transactions? As that is what I would like to actually be testing

elichai commented 8 years ago

You should run this script with replace-by-fee patch.

petertodd commented 7 years ago

@FrozenPrincess Bitcoin Core now supports a command line option to make it generate BIP125 replacable transactions: https://github.com/bitcoin/bitcoin/pull/8601

The doublespend.py script doesn't support generating them right now, but that'd be a useful command line option to add to it.

And yes, you should be using the replace-by-fee patch; latest is here: https://github.com/petertodd/bitcoin/tree/replace-by-fee-v0.13.0