Alternative to #8199 and #8200:
- Make sure to sync the nodes when required
- Make sure the fee has the correct amount without doing an assert_equal
Works for me - when I run fundrawtransaction.py in a loop without this patch it fails once in a while with InsufficientFunds, I've now been running with this patch for quite some time and haven't got one error.
ACK fae1d06
692 | - assert_equal(result['fee']*2, result2['fee']) 693 | - assert_equal(result['fee']*10, result3['fee']) 694 | + result_fee_rate = result['fee'] * 1000 / count_bytes(result['hex']) 695 | + assert_fee_amount(result2['fee'], count_bytes(result2['hex']), 2 * result_fee_rate) 696 | + assert_fee_amount(result3['fee'], count_bytes(result3['hex']), 10 * result_fee_rate) 697 |
fun fact: result_fee_rate != min_relay_tx_fee, even though it should. I should look into this to see if we can do any better.