Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_basic.py
Show First 20 Lines • Show All 528 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# Make a long chain of unconfirmed payments without hitting mempool limit | # Make a long chain of unconfirmed payments without hitting mempool limit | ||||
# Each tx we make leaves only one output of change on a chain 1 longer | # Each tx we make leaves only one output of change on a chain 1 longer | ||||
# Since the amount to send is always much less than the outputs, we only ever need one output | # Since the amount to send is always much less than the outputs, we only ever need one output | ||||
# So we should be able to generate exactly chainlimit txs for each | # So we should be able to generate exactly chainlimit txs for each | ||||
# original output | # original output | ||||
sending_addr = self.nodes[1].getnewaddress() | sending_addr = self.nodes[1].getnewaddress() | ||||
txid_list = [] | txid_list = [] | ||||
for i in range(chainlimit * 2): | for _ in range(chainlimit * 2): | ||||
txid_list.append(self.nodes[0].sendtoaddress( | txid_list.append(self.nodes[0].sendtoaddress( | ||||
sending_addr, Decimal('10000'))) | sending_addr, Decimal('10000'))) | ||||
assert_equal(self.nodes[0].getmempoolinfo()['size'], chainlimit * 2) | assert_equal(self.nodes[0].getmempoolinfo()['size'], chainlimit * 2) | ||||
assert_equal(len(txid_list), chainlimit * 2) | assert_equal(len(txid_list), chainlimit * 2) | ||||
# Without walletrejectlongchains, we will still generate a txid | # Without walletrejectlongchains, we will still generate a txid | ||||
# The tx will be stored in the wallet but not accepted to the mempool | # The tx will be stored in the wallet but not accepted to the mempool | ||||
extra_txid = self.nodes[0].sendtoaddress( | extra_txid = self.nodes[0].sendtoaddress( | ||||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |