Changeset View
Changeset View
Standalone View
Standalone View
test/functional/mining_prioritisetransaction.py
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# | # | ||||
# NOTE WELL: gettransaction returns the fee as a negative number and | # NOTE WELL: gettransaction returns the fee as a negative number and | ||||
# as fractional coins. However, the prioritisetransaction expects a | # as fractional coins. However, the prioritisetransaction expects a | ||||
# number of satoshi to add or subtract from the actual fee. | # number of satoshi to add or subtract from the actual fee. | ||||
# Thus the conversation here is simply int(tx_fee*COIN) to remove all fees, and then | # Thus the conversation here is simply int(tx_fee*COIN) to remove all fees, and then | ||||
# we add the minimum fee back. | # we add the minimum fee back. | ||||
tx_fee = self.nodes[0].gettransaction(high_fee_tx)['fee'] | tx_fee = self.nodes[0].gettransaction(high_fee_tx)['fee'] | ||||
self.nodes[0].prioritisetransaction( | self.nodes[0].prioritisetransaction( | ||||
high_fee_tx, -1e15, int(tx_fee*COIN) + self.nodes[0].calculate_fee_from_txid(high_fee_tx)) | high_fee_tx, -1e15, int(tx_fee * COIN) + self.nodes[0].calculate_fee_from_txid(high_fee_tx)) | ||||
# Add everything back to mempool | # Add everything back to mempool | ||||
self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash()) | self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash()) | ||||
# Check to make sure our high fee rate tx is back in the mempool | # Check to make sure our high fee rate tx is back in the mempool | ||||
mempool = self.nodes[0].getrawmempool() | mempool = self.nodes[0].getrawmempool() | ||||
assert high_fee_tx in mempool | assert high_fee_tx in mempool | ||||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |