aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/prioritise_transaction.py
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-03-07 19:12:58 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2017-03-07 19:30:23 +0100
commit30ff3a2fc95ca6e5b87e6d0f86e54ed9069dae5e (patch)
tree902350468c8aea2d83dff3f177143c10f95c0e3f /qa/rpc-tests/prioritise_transaction.py
parent3178b2c740f1ca3a90956e2e29012e8aa3c05e62 (diff)
parentb421e6ddcf00f220732f43742393452bb8bf4cdd (diff)
downloadbitcoin-30ff3a2fc95ca6e5b87e6d0f86e54ed9069dae5e.tar.xz
Merge #9602: Remove coin age priority and free transactions - implementation
b421e6d Update example bitcoin.conf (Alex Morcos) 7d4e950 Allow setting minrelaytxfee to 0 (Alex Morcos) 359e8a0 [cleanup] Remove coin age priority completely. (Alex Morcos) f9b9371 [rpc] Remove priorityDelta from prioritisetransaction (Alex Morcos) 49be7e1 [rpc] Remove priority information from mempool RPC calls (Alex Morcos) 0315888 [test] Remove priority from tests (Alex Morcos) f838005 No longer allow "free" transactions (Alex Morcos) ad727f4 [rpc] sendrawtransaction no longer bypasses minRelayTxFee (Alex Morcos) fe282ac [cleanup] Remove estimatePriority and estimateSmartPriority (Alex Morcos) 400b151 [debug] Change -printpriority option (Alex Morcos) 272b25a [mining] Remove -blockprioritysize. (Alex Morcos) 12839cd [rpc] Remove estimatepriority and estimatesmartpriority. (Alex Morcos) ddf58c7 wallet: Remove sendfree (MarcoFalke) Tree-SHA512: a9a4499405923ce794ef18f9e334dbbd59dfc73a3dc2df6f85cc9c62af6f353ec2eed9c2d5e58e904f918d0d7ab738f403dd4939d9bc2276136864fe63710782
Diffstat (limited to 'qa/rpc-tests/prioritise_transaction.py')
-rwxr-xr-xqa/rpc-tests/prioritise_transaction.py34
1 files changed, 11 insertions, 23 deletions
diff --git a/qa/rpc-tests/prioritise_transaction.py b/qa/rpc-tests/prioritise_transaction.py
index 9a63d0838f..13be6eeead 100755
--- a/qa/rpc-tests/prioritise_transaction.py
+++ b/qa/rpc-tests/prioritise_transaction.py
@@ -50,10 +50,8 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
assert(sizes[i] > MAX_BLOCK_BASE_SIZE) # Fail => raise utxo_count
# add a fee delta to something in the cheapest bucket and make sure it gets mined
- # also check that a different entry in the cheapest bucket is NOT mined (lower
- # the priority to ensure its not mined due to priority)
- self.nodes[0].prioritisetransaction(txids[0][0], 0, int(3*base_fee*COIN))
- self.nodes[0].prioritisetransaction(txids[0][1], -1e15, 0)
+ # also check that a different entry in the cheapest bucket is NOT mined
+ self.nodes[0].prioritisetransaction(txids[0][0], int(3*base_fee*COIN))
self.nodes[0].generate(1)
@@ -72,7 +70,7 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
# Add a prioritisation before a tx is in the mempool (de-prioritising a
# high-fee transaction so that it's now low fee).
- self.nodes[0].prioritisetransaction(high_fee_tx, -1e15, -int(2*base_fee*COIN))
+ self.nodes[0].prioritisetransaction(high_fee_tx, -int(2*base_fee*COIN))
# Add everything back to mempool
self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())
@@ -96,7 +94,7 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
if (x != high_fee_tx):
assert(x not in mempool)
- # Create a free, low priority transaction. Should be rejected.
+ # Create a free transaction. Should be rejected.
utxo_list = self.nodes[0].listunspent()
assert(len(utxo_list) > 0)
utxo = utxo_list[0]
@@ -104,37 +102,27 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
inputs = []
outputs = {}
inputs.append({"txid" : utxo["txid"], "vout" : utxo["vout"]})
- outputs[self.nodes[0].getnewaddress()] = utxo["amount"] - self.relayfee
+ outputs[self.nodes[0].getnewaddress()] = utxo["amount"]
raw_tx = self.nodes[0].createrawtransaction(inputs, outputs)
tx_hex = self.nodes[0].signrawtransaction(raw_tx)["hex"]
- txid = self.nodes[0].sendrawtransaction(tx_hex)
-
- # A tx that spends an in-mempool tx has 0 priority, so we can use it to
- # test the effect of using prioritise transaction for mempool acceptance
- inputs = []
- inputs.append({"txid": txid, "vout": 0})
- outputs = {}
- outputs[self.nodes[0].getnewaddress()] = utxo["amount"] - self.relayfee
- raw_tx2 = self.nodes[0].createrawtransaction(inputs, outputs)
- tx2_hex = self.nodes[0].signrawtransaction(raw_tx2)["hex"]
- tx2_id = self.nodes[0].decoderawtransaction(tx2_hex)["txid"]
+ tx_id = self.nodes[0].decoderawtransaction(tx_hex)["txid"]
try:
- self.nodes[0].sendrawtransaction(tx2_hex)
+ self.nodes[0].sendrawtransaction(tx_hex)
except JSONRPCException as exp:
assert_equal(exp.error['code'], -26) # insufficient fee
- assert(tx2_id not in self.nodes[0].getrawmempool())
+ assert(tx_id not in self.nodes[0].getrawmempool())
else:
assert(False)
# This is a less than 1000-byte transaction, so just set the fee
# to be the minimum for a 1000 byte transaction and check that it is
# accepted.
- self.nodes[0].prioritisetransaction(tx2_id, 0, int(self.relayfee*COIN))
+ self.nodes[0].prioritisetransaction(tx_id, int(self.relayfee*COIN))
print("Assert that prioritised free transaction is accepted to mempool")
- assert_equal(self.nodes[0].sendrawtransaction(tx2_hex), tx2_id)
- assert(tx2_id in self.nodes[0].getrawmempool())
+ assert_equal(self.nodes[0].sendrawtransaction(tx_hex), tx_id)
+ assert(tx_id in self.nodes[0].getrawmempool())
if __name__ == '__main__':
PrioritiseTransactionTest().main()