test: Check that wallet txs not in the mempool are untrusted
This commit is contained in:
parent
fa195315e6
commit
fad03cd046
1 changed files with 11 additions and 0 deletions
|
@ -41,6 +41,10 @@ class WalletTest(BitcoinTestFramework):
|
|||
def set_test_params(self):
|
||||
self.num_nodes = 2
|
||||
self.setup_clean_chain = True
|
||||
self.extra_args = [
|
||||
['-limitdescendantcount=3'], # Limit mempool descendants as a hack to have wallet txs rejected from the mempool
|
||||
[],
|
||||
]
|
||||
|
||||
def skip_test_if_missing_module(self):
|
||||
self.skip_if_no_wallet()
|
||||
|
@ -145,6 +149,13 @@ class WalletTest(BitcoinTestFramework):
|
|||
after = self.nodes[1].getunconfirmedbalance()
|
||||
assert_equal(before + Decimal('0.1'), after)
|
||||
|
||||
# Create 3 more wallet txs, where the last is not accepted to the
|
||||
# mempool because it is the third descendant of the tx above
|
||||
for _ in range(3):
|
||||
txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 99)
|
||||
assert txid not in self.nodes[0].getrawmempool()
|
||||
assert_equal(self.nodes[0].getbalance(minconf=0), 0) # wallet txs not in the mempool are untrusted
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
WalletTest().main()
|
||||
|
|
Loading…
Reference in a new issue