File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,10 @@ class WalletTest(BitcoinTestFramework):
41
41
def set_test_params (self ):
42
42
self .num_nodes = 2
43
43
self .setup_clean_chain = True
44
+ self .extra_args = [
45
+ ['-limitdescendantcount=3' ], # Limit mempool descendants as a hack to have wallet txs rejected from the mempool
46
+ [],
47
+ ]
44
48
45
49
def skip_test_if_missing_module (self ):
46
50
self .skip_if_no_wallet ()
@@ -145,6 +149,13 @@ def test_balances(*, fee_node_1=0):
145
149
after = self .nodes [1 ].getunconfirmedbalance ()
146
150
assert_equal (before + Decimal ('0.1' ), after )
147
151
152
+ # Create 3 more wallet txs, where the last is not accepted to the
153
+ # mempool because it is the third descendant of the tx above
154
+ for _ in range (3 ):
155
+ txid = self .nodes [0 ].sendtoaddress (self .nodes [0 ].getnewaddress (), 99 )
156
+ assert txid not in self .nodes [0 ].getrawmempool ()
157
+ assert_equal (self .nodes [0 ].getbalance (minconf = 0 ), 0 ) # wallet txs not in the mempool are untrusted
158
+
148
159
149
160
if __name__ == '__main__' :
150
161
WalletTest ().main ()
You can’t perform that action at this time.
0 commit comments