diff options
author | MarcoFalke <falke.marco@gmail.com> | 2019-04-05 15:26:00 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2019-04-30 15:11:52 -0400 |
commit | fad03cd0469c359e14a85bc98eea8a1e1379bd3e (patch) | |
tree | 8b73c8d8333bfedd8c389ff7360b8891316beaf3 /test/functional | |
parent | fa195315e686f7d77e7fd5c1fd54485ccc8116f0 (diff) | |
download | bitcoin-fad03cd0469c359e14a85bc98eea8a1e1379bd3e.tar.xz |
test: Check that wallet txs not in the mempool are untrusted
Diffstat (limited to 'test/functional')
-rwxr-xr-x | test/functional/wallet_balance.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/functional/wallet_balance.py b/test/functional/wallet_balance.py index 3b2aa132b3..65a6eda1cb 100755 --- a/test/functional/wallet_balance.py +++ b/test/functional/wallet_balance.py @@ -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() |