def test_unconfirmed_not_spendable(rbf_node, rbf_node_address):
    rbfid = create_fund_sign_send(rbf_node, {rbf_node_address: 0.09})
    rbftx = rbf_node.gettransaction(rbfid)['hex']
    assert (rbfid in rbf_node.getrawmempool())
    bumpid = rbf_node.bumpfee(rbfid)['txid']
    assert (bumpid in rbf_node.getrawmempool())
    assert (rbfid not in rbf_node.getrawmempool())
    assert_equal([t for t in rbf_node.listunspent(minconf=0, include_unsafe=False) if (t['txid'] == bumpid)], [])
    block = submit_block_with_tx(rbf_node, rbftx)
    rbf_node.abandontransaction(bumpid)
    rbf_node.invalidateblock(block.hash)
    assert (bumpid not in rbf_node.getrawmempool())
    assert (rbfid in rbf_node.getrawmempool())
    assert_equal([t for t in rbf_node.listunspent(minconf=0, include_unsafe=False) if (t['txid'] == rbfid)], [])
    rbf_node.generate(1)
    assert_equal(sum((1 for t in rbf_node.listunspent(minconf=0, include_unsafe=False) if ((t['txid'] == rbfid) and (t['address'] == rbf_node_address) and t['spendable']))), 1)
def test_unconfirmed_not_spendable(rbf_node, rbf_node_address):
    rbfid = create_fund_sign_send(rbf_node, {rbf_node_address: 0.09})
    rbftx = rbf_node.gettransaction(rbfid)['hex']
    assert (rbfid in rbf_node.getrawmempool())
    bumpid = rbf_node.bumpfee(rbfid)['txid']
    assert (bumpid in rbf_node.getrawmempool())
    assert (rbfid not in rbf_node.getrawmempool())
    assert_equal([t for t in rbf_node.listunspent(minconf=0, include_unsafe=False) if (t['txid'] == bumpid)], [])
    block = submit_block_with_tx(rbf_node, rbftx)
    rbf_node.abandontransaction(bumpid)
    rbf_node.invalidateblock(block.hash)
    assert (bumpid not in rbf_node.getrawmempool())
    assert (rbfid in rbf_node.getrawmempool())
    assert_equal([t for t in rbf_node.listunspent(minconf=0, include_unsafe=False) if (t['txid'] == rbfid)], [])
    rbf_node.generate(1)
    assert_equal(sum((1 for t in rbf_node.listunspent(minconf=0, include_unsafe=False) if ((t['txid'] == rbfid) and (t['address'] == rbf_node_address) and t['spendable']))), 1)