Changeset View
Changeset View
Standalone View
Standalone View
test/functional/mempool_limit.py
Show All 30 Lines | def run_test(self): | ||||
inputs = [{"txid": us0["txid"], "vout": us0["vout"]}] | inputs = [{"txid": us0["txid"], "vout": us0["vout"]}] | ||||
outputs = {self.nodes[0].getnewaddress(): 0.0001} | outputs = {self.nodes[0].getnewaddress(): 0.0001} | ||||
tx = self.nodes[0].createrawtransaction(inputs, outputs) | tx = self.nodes[0].createrawtransaction(inputs, outputs) | ||||
# specifically fund this tx with low fee | # specifically fund this tx with low fee | ||||
self.nodes[0].settxfee(relayfee) | self.nodes[0].settxfee(relayfee) | ||||
txF = self.nodes[0].fundrawtransaction(tx) | txF = self.nodes[0].fundrawtransaction(tx) | ||||
# return to automatic fee selection | # return to automatic fee selection | ||||
self.nodes[0].settxfee(0) | self.nodes[0].settxfee(0) | ||||
txFS = self.nodes[0].signrawtransaction(txF['hex']) | txFS = self.nodes[0].signrawtransactionwithwallet(txF['hex']) | ||||
txid = self.nodes[0].sendrawtransaction(txFS['hex']) | txid = self.nodes[0].sendrawtransaction(txFS['hex']) | ||||
for i in range(utxo_groups): | for i in range(utxo_groups): | ||||
txids.append([]) | txids.append([]) | ||||
txids[i] = send_big_transactions( | txids[i] = send_big_transactions( | ||||
self.nodes[0], utxos[30 * i:30 * i + 30], 30, 10 * (i + 1)) | self.nodes[0], utxos[30 * i:30 * i + 30], 30, 10 * (i + 1)) | ||||
# by now, the tx should be evicted, check confirmation state | # by now, the tx should be evicted, check confirmation state | ||||
assert(txid not in self.nodes[0].getrawmempool()) | assert(txid not in self.nodes[0].getrawmempool()) | ||||
txdata = self.nodes[0].gettransaction(txid) | txdata = self.nodes[0].gettransaction(txid) | ||||
assert(txdata['confirmations'] == 0) # confirmation should still be 0 | assert(txdata['confirmations'] == 0) # confirmation should still be 0 | ||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
MempoolLimitTest().main() | MempoolLimitTest().main() |