# Adding one more transaction on to the chain should fail.
assert_raises_rpc_error(-26,"too-long-mempool-chain, too many unconfirmed ancestors [limit: 25]",chain_transaction,self.nodes[0],[txid],[0],value,fee,1)
assert_raises_rpc_error(-26,"too-long-mempool-chain, too many unconfirmed ancestors [limit: 25]",self.chain_tx,[utxo])
# ...even if it chains on from some point in the middle of the chain.
assert_raises_rpc_error(-26,"too-long-mempool-chain, too many descendants",chain_transaction,self.nodes[0],[chain[2][0]],[1],chain[2][1],fee,1)
assert_raises_rpc_error(-26,"too-long-mempool-chain, too many descendants",chain_transaction,self.nodes[0],[chain[1][0]],[1],chain[1][1],fee,1)
assert_raises_rpc_error(-26,"too-long-mempool-chain, too many descendants",self.chain_tx,[chain[2]])
assert_raises_rpc_error(-26,"too-long-mempool-chain, too many descendants",self.chain_tx,[chain[1]])
# ...even if it chains on to two parent transactions with one in the chain.
assert_raises_rpc_error(-26,"too-long-mempool-chain, too many descendants",chain_transaction,self.nodes[0],[chain[0][0],second_chain],[1,0],chain[0][1]+second_chain_value,fee,1)
assert_raises_rpc_error(-26,"too-long-mempool-chain, too many descendants",self.chain_tx,[chain[0],second_chain])
# ...especially if its > 40k weight
assert_raises_rpc_error(-26,"too-long-mempool-chain, too many descendants",chain_transaction,self.nodes[0],[chain[0][0]],[1],chain[0][1],fee,350)
assert_raises_rpc_error(-26,"too-long-mempool-chain, too many descendants",self.chain_tx,[chain[0]],num_outputs=350)
# But not if it chains directly off the first transaction