Changeset View
Changeset View
Standalone View
Standalone View
test/functional/mining_prioritisetransaction.py
Show First 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
inputs.append({"txid": txid, "vout": 0}) | inputs.append({"txid": txid, "vout": 0}) | ||||
outputs = {} | outputs = {} | ||||
outputs[self.nodes[0].getnewaddress()] = utxo["amount"] - self.relayfee | outputs[self.nodes[0].getnewaddress()] = utxo["amount"] - self.relayfee | ||||
raw_tx2 = self.nodes[0].createrawtransaction(inputs, outputs) | raw_tx2 = self.nodes[0].createrawtransaction(inputs, outputs) | ||||
tx2_hex = self.nodes[0].signrawtransactionwithwallet(raw_tx2)["hex"] | tx2_hex = self.nodes[0].signrawtransactionwithwallet(raw_tx2)["hex"] | ||||
tx2_id = self.nodes[0].decoderawtransaction(tx2_hex)["txid"] | tx2_id = self.nodes[0].decoderawtransaction(tx2_hex)["txid"] | ||||
# This will raise an exception due to min relay fee not being met | # This will raise an exception due to min relay fee not being met | ||||
assert_raises_rpc_error(-26, "66: insufficient priority", | assert_raises_rpc_error(-26, "insufficient priority (code 66)", | ||||
self.nodes[0].sendrawtransaction, tx2_hex) | self.nodes[0].sendrawtransaction, tx2_hex) | ||||
assert(tx2_id not in self.nodes[0].getrawmempool()) | assert(tx2_id not in self.nodes[0].getrawmempool()) | ||||
# This is a less than 1000-byte transaction, so just set the fee | # 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 | # to be the minimum for a 1000 byte transaction and check that it is | ||||
# accepted. | # accepted. | ||||
self.nodes[0].prioritisetransaction( | self.nodes[0].prioritisetransaction( | ||||
tx2_id, 0, int(self.relayfee * COIN)) | tx2_id, 0, int(self.relayfee * COIN)) | ||||
Show All 21 Lines |